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

why to use setproperty method in Java Bean including * symbol  RSS feed

 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are we using setProperty method including "*" symbol in the below piece of code.



What actually the second line of code is doing and why we are only assigning the property as * not any other symbol. As i tried all these and found error during compilation.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
buntha Choudhary wrote:Why are we using setProperty method including "*" symbol in the below piece of code

We aren't.

That's a very old-fashioned and discredited way to set the values of the bean when it was deemed OK to submit forms to JSPs for processing. That is no longer an accepted practice.

Form submissions should be made to servlets which then direct the processing of the data. Within the servlet you can obtain the parameter values individually via getParameter(), or you can fetch the Jakarta BeanUtils project and use BeanUtils.populate() to automatically populate a bean with the parameter values.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!