Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

beans!

 
ashok khetan
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
one simple query....in the case of beans does the case of the property-name matters? e.g.
<jsp:setProperty name="obj" property='age' />
or
<jsp:setProperty name="obj" property='AGE' />
I tried it and both are working fine.So is it by default or depends on the server?
ashok.
 
Peter Masreblta
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tomcat will give:
org.apache.jasper.JasperException: Cannot find any information on property 'AGE' in a bean of type 'BeanName'
 
sridhar satuloori
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per JSP1.1 spec property is the name of the "Bean property" whose value you want to set.
from JavaBeans specification "If we discover a matching pair of �get<PropertyName>� and �set<PropertyName>� methods that take and return the same type, then we regard these methods as defining a read-write property
whose name will be �<propertyName>�. "

From above two specs i feel property is case sensitive, also "property" should be the same as the <b>property name</b> in the bean class.
but i have seen container behaving inconsistently.
Pls. correct me if i am wrong
Sridhar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic