• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaBean Property value

 
virgil tual
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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.
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Yup, I understand it now completly - I see where I went wrong.

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!