You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/10/04 21:47:32 UTC
DO NOT REPLY [Bug 31531] New: -
handleSetProperty throws IllegalArgumentException for no reason ...
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=31531>.
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=31531
handleSetProperty throws IllegalArgumentException for no reason ...
Summary: handleSetProperty throws IllegalArgumentException for no
reason ...
Product: Tomcat 5
Version: 5.0.28
Platform: PC
OS/Version: Other
Status: NEW
Severity: Major
Priority: Other
Component: Jasper
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: mail@peneios.com
Hi,
I noticed the following today: If with the following code (jsp/jsp compiled/java
class) jasper will throw an "IllegalArgumentException: argument type mismatch",
even so there IS a proper set method available. It will only work if I add an
additional set method with an Object type parameter ... However, this is not the
method that will get called, but it will avoid the exception.
JSP:
<jsp:useBean id="total" class="com.vote4ad.cart.BeanDouble" />
<bean:define id="price" name="item" property="price" type="java.lang.Double"
scope="page" />
<jsp:setProperty name="total" property="add" value="<%=price%>" /> // EXCEPTION
THROWN HERE
JSP->Java:
java.lang.Double price = null;
price = (java.lang.Double) _jspx_page_context.findAttribute("price");
org.apache.jasper.runtime.JspRuntimeLibrary.handleSetProperty(_jspx_page_context.findAttribute("total"),"add",price);
Snip from BeanDouble class:
public void setAdd(java.lang.Double x) { add(x); }
public void setAdd(double x) { add(x); }
public void setAdd(String x) { add(x); }
Without adding the following, an exception will be thrown as described above ...
public void setAdd(Object x) {}
Thanks
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org