It auot-populates every property in a javabean that has a matching setXXX()
method to an <input..> tag of the form.

For example:

<jsp:useBean id="mybean" scope="session" class="...." />
<jsp:setProperty name="mybean" property="*" />

<input type="text" name="firstName" value="<%= mybean.getFirstName() %>">

in your javabean you have:

private String  firstName = "";

public String getFirstName()
{
  return firstName;
}

public void setFirstName(String value)
{
  firstName = value;
}



Thats it! Now..keep in mind for <select..> tags in HTML, and drop-down
boxes, etc..there are different ways of handling this. Any form element that
can have multiple values, you need to use request.getParameters("name of
element") normally. In a javabean with get/set methods, you are passed a
comma delimited string, each token being one of the parameters. You then
parse it using a StringTokenizer into a String[] array and have your
selected items that way.

Hope that helps.

> Hello,
>
> Would you please tell me what does * do in the following?
> <jsp:setProperty name = "mybean" property="*" />
>
> Thanks and regards
> BRN.
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to