Suppose a JSP form has, among other elements, a listbox that allows the user to make multiple selections. After the form is submitted

Mobushir Hingorjo

Just define the setter method of the bean to accept a String[] as argument.
For example if you have multiple selections of the name "listvalue", then your setter method will look like:

public void setListvalue(String [] listvalue) {
this.listvalue = listvalue;
}

The JSP engine will automatically create a String array of all parameters named "listvalue" and pass that array to the setter method.

The setProperty tag will work as usual. You can use either the property="*" for all parameters or property="listvalue" for just the listvalue parameter.
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact