list<pagedata> jsp hidden domain, back to Java

Source: Internet
Author: User

Java for JSP, the code is as follows:

     /**go to modify page *@param     * @throwsException*/@RequestMapping (Value= "/goedit")     PublicModelandview Goedit (model model)throwsexception{Modelandview MV= This. Getmodelandview (); Pagedata PD=NewPagedata (); PD= This. Getpagedata (); //get a tree-shaped listJsonarray arr = jsonarray.fromobject (Goodstypeservice.listallgoodstypenourl ("0"));//The first level ID of the product type is filled here;String JSON =arr.tostring (); JSON= Json.replaceall ("goodstype_id", "ID"). ReplaceAll ("Goodstype_parentid", "PId"). ReplaceAll ("Goodstype_name", "NAME "). ReplaceAll (" Subdict "," nodes "). ReplaceAll (" Hasdict "," checked "). ReplaceAll (" Treeurl "," url "); Model.addattribute ("Ztreenodes", JSON); Mv.addobject ("goodstype_id", 0);//0 represents the root directoryPD= Receivingstandardservice.findbyid (PD);//read by ID//query all items according to the harvest criteriaList<pagedata> wllist =receivingstandardmaterielservice.findwlbyreceivingstandard_id (PD); //Search all plants according to the harvest criteriaList<pagedata> gclist =receivingstandardfactoryservice.findgcbyreceivingstandard_id (PD); Mv.setviewname ("Cgxtpt/receivingstandard/receivingstandard_edit"); Mv.addobject ("MSG", "edit"); Mv.addobject ("Wllist", Jsonarray.fromobject (wllist)); ----focus is here Mv.addobject ("Gclist", Jsonarray.fromobject (gclist)); Mv.addobject ("PD", PD); returnMV; }

Reception JSP Reception:

<input type= "hidden" name= "wllist" id= "wllist" Value= ' ${wllist} ' > <input type= "hidden" name= "Gclist" id= " Gclist "Value= ' ${gclist} ' >

Form forms submitted to Java processing

    /**Modify *@param     * @throwsException*/@RequestMapping (Value= "/edit")     PublicModelandview edit ()throwsexception{Logbefore (Logger, jurisdiction.getusername ()+ "Modify Receivingstandard"); if(! Jurisdiction.buttonjurisdiction (Menuurl, "edit")) {return NULL;}//Verify PermissionsModelandview mv = This. Getmodelandview (); Pagedata PD=NewPagedata (); PD= This. Getpagedata ();        Receivingstandardservice.edit (PD); /**Operation Record*/Session Session=jurisdiction.getsession (); User User=(User) Session.getattribute (Const.session_user); Pagedata PD1=NewPagedata (); Pd1.put ("Receivingstandardrecord_id", This. Get32uuid ()); Pd1.put ("Receivingstandard_id", Pd.getstring ("receivingstandard_id")); Pd1.put ("Updaterid", user.getuser_id ()); Pd1.put ("UpdateName", User.getname ()); Pd1.put ("UpdateTime", Dateutil.gettime ());        Receivingstandardrecordservice.save (PD1); /**end of Operation Record*/        //query all items according to the harvest criteriaList<pagedata> wllist =receivingstandardmaterielservice.findwlbyreceivingstandard_id (PD); //Search all plants according to the harvest criteriaList<pagedata> gclist =receivingstandardfactoryservice.findgcbyreceivingstandard_id (PD); //the previous itemlist<jsonobject> oldwllist = Jsonarray.fromobject (Pd.get ("Wllist")) ; ----------The point is here .//before the factorylist<jsonobject> oldgclist = Jsonarray.fromobject (Pd.get ("Gclist")) ; //all previous materials and factories were removedString MSG2 = Orderdataservice.sendwmszjornojson (oldwllist, Oldgclist, "N"); //now the material, the factory all plusString msg = Orderdataservice.sendwmszjorno (wllist, Gclist, "Y"); System.out.println ("Material ..... "+msg+MSG2); Mv.addobject ("MSG", "Success"); Mv.setviewname ("Save_result"); returnMV; }

Two types of data, one is the Pagedata one is the Jsonobject, the latter gets the data is: get ();

  

list<pagedata> jsp hidden domain, back to Java

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.