This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java bean , jsp page and parameters

 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTML Form
Java Class

JSP PAGE - SavePage.jsp


1 How does the parameters from html form get collected in Savename.jsp ? As there is no request.getParameter() ?

2 How do these parameters het transferred to java bean user ? user java class is called by the useBean, but how is each property assigned a particular value ?

thanks
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you declare property="*", the container will map all request parameters which names can be matched with a JavaBean Property setter method into the bean.

The idea is simple.

An input field of name email will invoke setEmail(String s) on the bean you use.

If you have input fields that don't have a bean setter, no worries, these are skipped, no exception is thrown.

As for how the container does it... the powerful capabilities of Reflections
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic