Holy crap.
On Thu, Oct 28, 2010 at 8:42 AM, cellterry <cellte...@gmail.com> wrote: > > Yes, sure, here in below: > > > package action; > > > > import java.util.*; > > import javax.servlet.http.HttpServletRequest; > > import org.apache.struts2.ServletActionContext; > > import com.opensymphony.xwork2.ActionContext; > > import com.opensymphony.xwork2.ActionSupport; > > > > @SuppressWarnings("serial") > > public class SoDetail extends ActionSupport { > > > > int maskPrepare=1; > > int maskCheck=2; > > int maskApprove=4; > > int maskCancel=8; > > int maskDeliver=16; > > int maskPay=32; > > int maskRevise=64; > > > > model.Emp me; > > model.SoDetail detail; > > model.So so; > > > > service.SoDetail serviceDetail; > > service.So serviceSo; > > service.Product serviceProduct; > > service.ProductPrice servicePrice; > > > > boolean ok; > > boolean cancel; > > boolean save; > > boolean selectProduct; > > boolean deliver; > > boolean pay; > > boolean refresh; > > > > String from; > > String from2; > > String mode; > > String mode2; > > > > List<model.ProductPrice> prices; > > > > public List<model.ProductPrice> getPrices() { > > return prices; > > } > > > > public void setPrices(List<model.ProductPrice> prices) { > > this.prices = prices; > > } > > > > public service.ProductPrice getServicePrice() { > > return servicePrice; > > } > > > > public void setServicePrice(service.ProductPrice servicePrice) { > > this.servicePrice = servicePrice; > > } > > > > public int getMaskPrepare() { > > return maskPrepare; > > } > > > > public int getMaskCheck() { > > return maskCheck; > > } > > > > public int getMaskApprove() { > > return maskApprove; > > } > > > > public int getMaskCancel() { > > return maskCancel; > > } > > > > public int getMaskDeliver() { > > return maskDeliver; > > } > > > > public int getMaskPay() { > > return maskPay; > > } > > > > public int getMaskRevise() { > > return maskRevise; > > } > > > > public model.So getSo() { > > return so; > > } > > > > public void setSo(model.So so) { > > this.so = so; > > } > > > > public boolean isRefresh() { > > return refresh; > > } > > > > public void setRefresh(boolean refresh) { > > this.refresh = refresh; > > } > > > > public model.Emp getMe() { > > return me; > > } > > > > public void setMe(model.Emp me) { > > this.me = me; > > } > > > > public String getMode2() { > > return mode2; > > } > > > > public void setMode2(String mode2) { > > this.mode2 = mode2; > > } > > > > public String getFrom2() { > > return from2; > > } > > > > public void setFrom2(String from2) { > > this.from2 = from2; > > } > > > > public service.So getServiceSo() { > > return serviceSo; > > } > > > > public void setServiceSo(service.So serviceSo) { > > this.serviceSo = serviceSo; > > } > > > > public String getMode() { > > return mode; > > } > > > > public void setMode(String mode) { > > this.mode = mode; > > } > > > > public service.Product getServiceProduct() { > > return serviceProduct; > > } > > > > public void setServiceProduct(service.Product serviceProduct) { > > this.serviceProduct = serviceProduct; > > } > > > > public String getFrom() { > > return from; > > } > > > > public void setFrom(String from) { > > this.from = from; > > } > > > > public void setSelectProduct(boolean selectProduct) { > > this.selectProduct = true; > > } > > > > public void setCancel(boolean b) { > > this.cancel = true; > > } > > > > public void setOk(boolean b) { > > this.ok = true; > > } > > > > public void setSave(boolean b) { > > this.save = true; > > } > > > > public void setDeliver(boolean b) { > > this.deliver = true; > > } > > > > public void setPay(boolean b) { > > this.pay = true; > > } > > > > public service.SoDetail getServiceDetail() { > > return serviceDetail; > > } > > > > public void setServiceDetail(service.SoDetail serviceDetail) { > > this.serviceDetail = serviceDetail; > > } > > > > public model.SoDetail getDetail() { > > return detail; > > } > > > > public void setDetail(model.SoDetail detail) { > > this.detail = detail; > > } > > > > public String execute() throws Exception > > { > > > me=(model.Emp)ActionContext.getContext().getSession().get("me"); > > > > if(me==null) > > { > > return "login"; > > } > > > > if((me.getAuth().getControlPO()&me.getAuth().getBROWSE())==0) > > { > > return "browse.auth.error"; > > } > > > > if(detail==null) > > { > > > detail=(model.SoDetail)ActionContext.getContext().getSession().get("detail"); > > } > > else > > { > > ActionContext.getContext().getSession().put("detail", > detail); > > } > > > > if(detail.getSo()==null) > > { > > Integer > i=(Integer)ActionContext.getContext().getSession().get("soID"); > > if(i==null) > > { > > > > } > > else > > { > > detail.setSo(serviceSo.get(i)); > > } > > } > > else > > { > > ActionContext.getContext().getSession().put("soID", > detail.getSo().getId()); > > } > > > > > if(detail==null||detail.getProduct()==null||detail.getProduct().getId()==null) > > { > > } > > else > > { > > > prices=servicePrice.getList(detail.getProduct().getId(),"quantity",true); > > } > > > > HttpServletRequest request = (HttpServletRequest) > ActionContext.getContext() > > .get(ServletActionContext.HTTP_REQUEST); > > > > if(mode==null) > > { > > } > > else > > { > > if(mode.equals("select2")) > > { > > String s=request.getParameter("product.id"); > > if(s==null) > > { > > } > > else > > { > > > detail.setProduct(serviceProduct.get(new Integer(s))); > > > ActionContext.getContext().getSession().put("detail", detail); > > } > > } > > } > > > > if(ok||save) > > { > > > if((me.getAuth().getControlPO()&me.getAuth().getEDIT())==0) > > { > > } > > else > > { > > model.SoDetail > detail2=serviceDetail.get(detail.getId()); > > detail.setStatus(detail2.getStatus()); > > > > if(detail.getId()==null) > > { > > serviceDetail.insert(detail); > > } > > else > > { > > serviceDetail.update(detail); > > } > > > > if(ok) > > { > > return "ok"; > > } > > else if(save) > > { > > return "input"; > > } > > } > > > > } > > else if(cancel) > > { > > return "cancel"; > > } > > else if(selectProduct) > > { > > mode2="select"; > > from2="soDetail"; > > return "selectProduct"; > > } > > else if(deliver||pay) > > { > > boolean flag=false; > > > > if(deliver) > > { > > > if((me.getAuth().getControlPO2()&model.So.getMaskDeliver())!=0){ > > flag=true; > > } > > } > > else if(pay) > > { > > > if((me.getAuth().getControlPO2()&model.So.getMaskPay())!=0){ > > flag=true; > > } > > } > > if(flag) > > { > > detail=serviceDetail.get(detail.getId()); > > > > if(deliver) > > { > > > detail.setStatus(detail.getStatus()|model.So.getMaskDeliver()); > > Calendar cal=Calendar.getInstance(); > > > detail.setDtDeliverActual(cal.getTime()); > > //terry > > cal.add(Calendar.DAY_OF_MONTH,30); > > detail.setDtPay(cal.getTime()); > > } > > else if(pay) > > { > > > detail.setStatus(detail.getStatus()|model.So.getMaskPay()); > > > detail.setDtPayActual(Calendar.getInstance().getTime()); > > } > > serviceDetail.update(detail); > > > > > ActionContext.getContext().getSession().put("detail",detail); > > return "input"; > > } > > } > > > > return "success"; > > } > > > > } > > > > > > > Li Ying wrote: >> >> I need see all your code before I can find what's going wrong. >> >> Can you show me the whole Action class and JSP? >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> >> > > -- > View this message in context: > http://old.nabble.com/The-requested-list-key-%27prices%27-could-not-be-resolved-as-a-collection-array-map-enumeration-iterator-type.-tp30074913p30076158.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >