8-11 no existing record when adding courier price

Source: Internet
Author: User

One, no duplicate record added

1. addexpressprice.jsp (show list of provinces in list)

<td> <div class= "Controls" ><form:select path= "Provinceid" > <form:options items= "${provincelist } "itemlabel=" label "itemvalue=" value "/> </form:select> </div></td>

2. Expresspricecontroller.java (Initialize page)

@RequestMapping (value = "Initaddexpressprice", method = requestmethod.get) public String Initaddexpressprice (Model mode    L, Expresspriceform expresspriceform) {log.info ("The price of the additional courier is initialized");    list<item> provincelist = Itemlistcomponent.getprovincelist1 (Expresspriceform.getexpressid ());    Model.addattribute ("Provincelist", provincelist);        Model.addattribute ("Expresspriceform", expresspriceform);    return "Manager/expressprice/addexpressprice"; }

3, Itemlistcomponent.java

Public list<item> GetProvinceList1 (String expressid) {return querydao.executeforobjectlist ("common.selectexpr Esspriceprovince ", Expressid);}

4, Commonsqlmap.xml

<select id= "selectexpresspriceprovince" parameterclass= "java.lang.String" resultclass= " Cn.agriculture.web.form.Item ">select Province_name as label,province_id as Valuefrom province WHERE not exists (Selec T express_price.province_idfrom express_price,expresswhere express_price.province_id=province.province_id A ND express.express_id=express_price.express_id and express.express_id= #value #) </select>

Second, the provinces are displayed in list form

1,addexpressprice.jsp

<form:select path= "Provinceid" ><form:options items= "${provincelist}" itemlabel= "label" itemValue= "value"/ ></form:select>

2, Itemlistcomponent.java

Public list<item> getprovincelist () {return querydao.executeforobjectlist ("common.selectprovince", null);} public string Getprovincelabel (string provincevalue) {return querydao.executeforobject ("Common.selectprovincelabel" , Provincevalue, String.class);}

3,Commonsqlmap.xml

<select id= "selectprovince" resultclass= "Cn.agriculture.web.form.Item" >select Province_name as Label,province _id as Valuefrom province</select><select id= "Selectprovincelabel" parameterclass= "java.lang.String" resultclass= "Java.lang.String" >select province_name as Labelfrom provincewhere province_id = #value #</select >


8-11 no existing record when adding courier price

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.