DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=29682>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=29682 passing a string value to jsp:setProperty Summary: passing a string value to jsp:setProperty Product: Tomcat 4 Version: 4.1.30 Platform: Sun OS/Version: Solaris Status: NEW Severity: Major Priority: Other Component: Jasper AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] We are moving from Weblogic 8.1 to Tomcat 4.1.30. We are calling a bean to retrieve data to be presented to the view. Two properties are being set using jsp:setProperty, both of the values passed are strings. One of which is a number represented as a String(type). Having taken a look at the jasper src I found that the only type that is not supported for the property value is String. It appears that it handles double, int, short, long, Object, etc... - but no String. public static void handleSetProperty(Object bean, String prop, double value) throws JasperException Steps to reproduce 1) create a bean to retrieve data the bean should include a setter method accepting a String 2) defne a variable of type String with the value of '1' 3) set the property in the JSP with the variable from '2)' Actual results Application failed. Expected results Application should display view (JSP) Error: exception org.apache.jasper.JasperException at org.apache.jasper.runtime.JspRuntimeLibrary.handleSetProperty(JspRuntimeLibrary.java:535) at org.apache.jsp.my_account_profile_jsp._jspService(my_account_profile_jsp.java:2380) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ........ root cause java.lang.IllegalArgumentException at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.jasper.runtime.JspRuntimeLibrary.handleSetProperty(JspRuntimeLibrary.java:533) at org.apache.jsp.my_account_profile_jsp._jspService(my_account_profile_jsp.java:2380) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ......... Example of code in compiled JSP for jsp:setProperty: JspRuntimeLibrary.handleSetProperty(pageContext.findAttribute("content"), "localeId",localeId); Is it part of the Servlet Spec not to handle this or is this just an oversight? If it is an oversight can it be included in subsequent releases, or is it a part of the spec and cannot be changed? Thanks, Harold --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]