Venkat Muthusamy wrote:
>
> Hi,
> Can you help me with the following things.
>
> 1.I am using the JSP with the bean.
>
> I tried to set the property using the setProperty
> tag.Unfortunately the it throws an exception while
> setting up the exception if theproperty name starts
> with UpperCase.
>
> for example
>
> Case1. <JSP setProperty id="bean1" property="test1" />
>  //this  is working.
>
> Case2. <JSP setProperty id="bean1" property="TESt1" />
> //this  is also working.
>
> Case3. <JSP setProperty id="bean1" property="Test1" />
> but this is not working.
>
> I coded in the bean with the setProperty method as
> follows  with starting UpperCase
>
> void setTest1(String Test1)
> {
>   this.Test1 = Test1;
> }

What you see is the correct behavior. The JavaBeans specification defines
these naming rules, i.e. that the property name starts with a lowercase
letter (foo) and the corresponding getter method starts with get plus
the property name with the first character capitalized (getFoo()). If
you do not follow these naming rules, the <jsp:setProperty> action will
not find the property access method.

See the JavaBeans spec for details.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to