Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java bean , jsp page and parameters  RSS feed

 
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!