You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Phillip Rhodes <rh...@yahoo.com> on 2001/12/21 20:26:30 UTC

No getter method for property (but it's there!)

I have an object type Scale that I am iterating over.  There is just ONE 
property that I can not access.
For example I run this fine:
<bean:write name="scalex" property="scaleName" filter="true"/>
<bean:write name="scalex" property="scaleDescription" filter="true"/>


But if I have:
<bean:write name="scalex" property="scaleId" filter="true"/>    I get a "No 
getter method for property scaleId of bean scalex" error

But the property is there.  If I can access it in my jsp using the below 
method:
<%
Scale x = (Scale) scalex;
out.println("hey=" + x.getScaleId());
%>

I can access other properties in other beans that adhere to the same naming 
convention, but this is one that it is having a problem with.

Any pointers would be appreciated!




Error encountered processing a template: 
/screens/ScaleIndex.jspjavax.servlet.ServletException: No getter method for 
property scaleId of bean scalex at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:442) 
at 
org.apache.jsp._0002ftemplates_0002fapp_0002fscreens_0002fScaleIndex_jsp._jspService(_0002ftemplates_0002fapp_0002fscreens_0002fScaleIndex_jsp.java:269) 
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200) 
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) 
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:565) 
at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:483) 
at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:408) 
at 
org.apache.turbine.services.jsp.TurbineJspService.handleRequest(TurbineJspService.java:191) 
at 


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: No getter method for property (but it's there!)

Posted by Phillip Rhodes <rh...@yahoo.com>.
The problem I found was that the property had overloaded accessor methods.

What I did was to create a new accessor method by a different name, and use 
this to refer to it within struts.



At 02:26 PM 12/21/2001 -0500, you wrote:
>I have an object type Scale that I am iterating over.  There is just ONE 
>property that I can not access.
>For example I run this fine:
><bean:write name="scalex" property="scaleName" filter="true"/>
><bean:write name="scalex" property="scaleDescription" filter="true"/>
>
>
>But if I have:
><bean:write name="scalex" property="scaleId" filter="true"/>    I get a 
>"No getter method for property scaleId of bean scalex" error
>
>But the property is there.  If I can access it in my jsp using the below 
>method:
><%
>Scale x = (Scale) scalex;
>out.println("hey=" + x.getScaleId());
>%>
>
>I can access other properties in other beans that adhere to the same 
>naming convention, but this is one that it is having a problem with.
>
>Any pointers would be appreciated!
>
>
>
>
>Error encountered processing a template: 
>/screens/ScaleIndex.jspjavax.servlet.ServletException: No getter method 
>for property scaleId of bean scalex at 
>org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:442) 
>at 
>org.apache.jsp._0002ftemplates_0002fapp_0002fscreens_0002fScaleIndex_jsp._jspService(_0002ftemplates_0002fapp_0002fscreens_0002fScaleIndex_jsp.java:269) 
>at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at 
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
>org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200) 
>at 
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) 
>at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453) at 
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:565) 
>at 
>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:483) 
>at 
>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:408) 
>at 
>org.apache.turbine.services.jsp.TurbineJspService.handleRequest(TurbineJspService.java:191) 
>at
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>