Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Required attribute for <jsp:setProperty>

 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this one from j2eecertificate.com:

Which of the following attributes are mandatory within the <jsp:setProperty> tag? [Check all correct answers]



1. Name
2. property
3. value
4. type
5. id


Surprisingly, the answer is....


















2. property.

I understand that if the property is a req param, the container will automatically map the param name to the value attribute. What I don't get: How can you set a property without first naming a bean?
 
melan hen
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following is what I get from JSP v2.0 Spec pg. 1-106
<jsp:setProperty name="beanName" prop_expr/>
prop_expr ::=
property="*" |
property="propertyName"|
property="propertyName" param="parameterName"|
property="propertyName" value="propertyValue"

propertyValue :: =string

I think both name and property is required,please correct me if I misunderstood.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!