• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

certain code not necessary for setting bean properties?

 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic