tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "andrew cooke" <and...@acooke.org>
Subject Passing values to tags [Was: Passing typed (non-String) data to tag file - error in getValueFromPropertyEditorManager]
Date Wed, 02 Nov 2005 02:59:14 GMT

More generally, I can't see how to pass a value at all!

If I change my tag to accept a string, then the value it receives if
${name} (literally).  This is true even if rtexprtype is explicitly set to
true.

I can force evaluation by calling
<data:name>
  <jsp:attribute name="value"><c:out value="${name}"/></jsp:attribute>
</data:name>
but that forces conversion to a String which is what I am trying to avoid...

Please can someone explain what I am missing?

Thanks/sorry,
Andrew

andrew cooke said:
>
> I have a JSP page that includes:
>    <c:out value="${name.class}"/>
>    <data:name value="${name}"/>
> and when the second line is commented out, the page prints
>    class org.acooke.collaborate.data.transport.Name
>
> However, when the second line is present, I get the error shown below.
> The appropriate code in the compiled JSP is:
> _jspx_th_data_name_0.setValue(
>  (org.acooke.collaborate.data.transport.Name)
>    org.apache.jasper.runtime.JspRuntimeLibrary.
>    getValueFromPropertyEditorManager(
>      org.acooke.collaborate.data.transport.Name.class,
>      "value", "${name}"));
> which corresponds directly to the line quoted above, and which has the
> correct class name.
>
> The class name is also declared for the data:name tag, although as far as
> I can see the problem is in the page code rather than the tag:
>    <%@ include file="/WEB-INF/jsp/include/headers.jsp" %>
>    <%@ tag body-content="empty" %>
>    <%@ attribute name="value" required="true"
>               type="org.acooke.collaborate.data.transport.Name" %>
>    ...
>
> Is this a bug?  I can find nothing in the bug database, but the code
> appears OK....
>
> Thanks,
> Andrew
>
>
> 2005-11-01 23:12:21,356 ERROR
> [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/collaborate].[jsp]]
> - Servlet.service() for servlet jsp threw exception
> org.apache.jasper.JasperException: jsp.error.beans.property.conversion
> 	at
> org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:885)
> 	at
> org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp._jspx_meth_data_name_0(org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp:361)
> 	at
> org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp._jspx_meth_c_forEach_0(org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp:307)
> 	at
> org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp.access$9(org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp:285)
> 	at
> org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp$contacts_jspHelper.invoke4(org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp:768)
> 	at
> org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp$contacts_jspHelper.invoke(org.apache.jsp.WEB_002dINF.jsp.member.contacts_jsp:928)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message