• 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

JavaBean Property value

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, I am new to JSP but have been doing JAVA for a while, and saw this line of code in a script and didn't really know what it meant. Anyone help me?



'username' is refering to the id of the instance of the class I just made, setName is the operation, and the property is what is passed in. I get all that, but what does the star (*) mean as the value? Does it mean it passes all of the variables in from the form? If so this seems quite wastefull.

Any help will do, thanks.
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<

jsp:setName name="username" property="*" />



Tag is <jsp:setProperty> & not <jsp:setName> & hence the confusion.

name="username" refers to id attribute in <jsp:useBean> tag which would be there, perhaps at the start of the page, so i suggest have a closer look at it & then read next stuff

if i correct the tag as <jsp:setProperty> instead of <jsp:setName> meaning is set all ('*' means all) the properties of javabean who's id is "username" specified in <jsp:useBean> tag.

In <jsp:useBean> tag you will find following attributes:
id--unique id for a JAvabean (Actually its a reference name)
class--fully qualified Classname of Javabean (i.e. including package name)
scope--scope of Specified java bean


Web container will instantiate JavaBean & reference (name Specified in "id" attribute will be pointing to that object)

I hope this helps..Otherwise feel free to throw more questions...

Shriniwas
 
virgil tual
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup, I understand it now completly - I see where I went wrong.

Thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic