tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vanlerberghe, Luc" <...@bvdep.com>
Subject RE: Problems with jsp:setProperty & introspection
Date Mon, 02 Oct 2000 13:25:01 GMT
When you define setCategoryNo and/or getCategoryNo, the property name is
"categoryNo" (first letter lowercase !), like a normal member variable would
be called if you follow the java coding conventions.

The parameters you pass to your jsp-page need to be in the proper case as
well, that's why the <jsp:setProperty name="category" property="*" /> didn't
work either...

Luc Vanlerberghe

> -----Original Message-----
> From: Richard Wooding [mailto:richard@camara.co.za]
> Sent: Monday, October 02, 2000 3:04 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Problems with jsp:setProperty & introspection
> 
> 
> Hi,
> 
> I am having trouble with jsp:setProperty
> 
> I have a bean CategoryBean which has the property CategoryNo
> the bean has a setCategoryNo and a getCategoryNo and it adheres to the
> JavaBean spec.
> 
> When I use the following code in jsp:
> 
> <jsp:useBean id="category" class="za.co.camara.fedhasa.CategoryBean"
> scope="request">
> <jsp:setProperty name="category" property="*" />
> </jsp:useBean>
> 
> it fails to set any of the parameters I pass to it:
> 
> <jsp:useBean id="category" class="za.co.camara.fedhasa.CategoryBean"
> scope="request">
> <jsp:setProperty name="category" property="CategoryNo">
> </jsp:useBean>
> 
> it generates the following exception:
> 
> Error: 500
> Location:/fedhasa/category.jsp
> Internal Servlet Error:
> 
> org.apache.jasper.JasperException: Cannot find any 
> information on property
> 'CategoryNo' in a bean of type 'za.co.camara.fedhasa.CategoryBean'
>  at
> org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(J
> spRuntimeLibra
> ry.java:211)
>  at
> _0002fcategory_0002ejspcategory_jsp_8._jspService(_0002fcatego
> ry_0002ejspcat
> egory_jsp_8.java:163)
>  at 
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> ......... etc.
> 
> This failure to successfully introspect properties is 
> happening with all  my
> beans.
> What could be causing this???
> 
> Richard Wooding - Developer - Camara Consulting
> e-mail: richard@camara.co.za icq: 7082626 msn: richard@camara.co.za
> 
> 139 Hatfield Str, Gardens, Cape Town, 8001 Tel (Work): +27 
> (21) 4652138 Tel
> (Home): +27 (21) 4652544
> 


Mime
View raw message