• Post Reply Bookmark Topic Watch Topic
  • New Topic

certain code not necessary for setting bean properties?

 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting confused by some code written by someone else.
For a while I've been used to typical JSP/HTML that sets bean properties like this:

However, I'm seeing regular HTML like this, and wondering if it's all that's needed to set a bean's properties:

If so, then I'm guessing that the reason is works is because of a simple line like this:
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like you've got some apples and oranges going here...
There's a difference between setting the values into a bean, and getting values from the bean to populate an HTML form control.
This statement:

uses the value of the amount property already set into the currentshipment bean to set the VALUE attribute of the input field. No bean setting is performed; just retrieval.
This statement:

has no bean interaction whatsoever when the page is being constructed. Like any other form field, it will submit its value when the form is submitted which could be used to populate a bean field on the submission request.
This statement:

will match any submission parameter to bean properties and set them.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!