struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shirishchandra.sakh...@ubs.com
Subject RE: org.apache.jasper.JasperException: No getter method for property appauth.aAuthLevel of bean element
Date Fri, 13 Dec 2002 08:34:08 GMT
Hi,
The problem has to do with java beans specification 1.01  section 8.8 
The mechanism used by java beans introspection to derive method names from 
property names is like this.
1.Append get/set to peoperty name and capitilise first letter of property.(e.g. 
for a property name, method names derived will be getName and setName)
2.But if second letter of property is also capital, then dont apply the 
capitalisation.(e.g for a property URL,method names derived will be getURL and 
setURL.)

And this is why u are having the problem.


regards,
Shirish

-----Original Message-----
From: david.karr [mailto:david.karr@attws.com]
Sent: Thursday, December 12, 2002 10:01 PM
To: struts-user
Subject: RE: org.apache.jasper.JasperException: No getter method for
property appauth.aAuthLevel of bean element


This is the "two starting caps" rule.  I don't know exactly how this 
translates, as I try to avoid this situation.  Change your property name (in 
both places) so that the second character is NOT a capital.  I believe this 
will solve this problem, at least that part.

> -----Original Message-----
> From: Jyothi Panduranga
> [mailto:jyothi.panduranga@contractor.openwave.com]
> Sent: Thursday, December 12, 2002 12:55 PM
> To: struts-user@jakarta.apache.org
> Subject: org.apache.jasper.JasperException: No getter method for
> property appauth.aAuthLevel of bean element
> 
> 
> Hi,
> 
>   I have been getting this error when I try to access a 
> property.  I have
> both getter and setter properties defined in the bean. Both 
> deals with the
> variable of same type.  Eg., I have this defined in my bean.
> 
>     /**
>      * Sets the value of field 'aAuthLevel'.
>      *
>      * @param aAuthLevel the value of field 'aAuthLevel'.
>     **/
>     public void setAAuthLevel(java.lang.String aAuthLevel)
>     {
>         this._aAuthLevel = aAuthLevel;
>     }
> 
>    /**
>      * gets the value of field 'aAuthLevel'.
>      *
>      *
>     **/
>     public String getAAuthLevel()
>     {
>         return this._aAuthLevel;
>     }
> 
> Here is the part of my JSP sniplet which calls the property
> 
>                 <td>
>                      <bean:write name="element"
> property="appauth.aAuthLevel" />
>                 </td>
> 
> I get this following error.
> 
> org.apache.jasper.JasperException: No getter method for property
> appauth.aAuthLevel of bean element
> 
> However, If I change the name of the getter and setter properties to
> getAuthLevel/setAuthLevel and JSP according do that(appauth.authLevel
> instead of appauth.aAuthLevel), then everything works fine.
> 
> I want to know if this is a bug in JSP or struts.  I use 
> Tomcat 4.1.12.
> Any insight would be helpful.
> 
> Thanks in advance,
> Jyothi
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message