You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by andrew cooke <an...@acooke.org> on 2005/11/02 03:59:14 UTC

Passing values to tags [Was: Passing typed (non-String) data to tag file - error in getValueFromPropertyEditorManager]

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


Re: Passing values to tags [Was: Passing typed (non-String) data to tag file - error in getValueFromPropertyEditorManager]

Posted by Rahul Akolkar <ra...@gmail.com>.
On 11/2/05, andrew cooke <an...@acooke.org> wrote:
>
> Thanks!  I don't yet have it (the page I asked about) running, but
> changing the web.xml to follow the spec (using the schema rather than the
> old 2_3 DTD) has cleared up a whole slew of strange behaviour.  Suddenly
> everything works as as it appears in the docs, error messages are helpful,
> etc etc...
<snip/>

And if you have container agnostic questions about authoring custom
taglibs, taglibs-user AT jakarta.apache.org [1] is a useful mailing
list.

-Rahul

[1] http://jakarta.apache.org/site/mail2.html#Taglibs


>
> Cheers,
> Andrew
<snap/>

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


Re: Passing values to tags [Was: Passing typed (non-String) data to tag file - error in getValueFromPropertyEditorManager]

Posted by andrew cooke <an...@acooke.org>.
Thanks!  I don't yet have it (the page I asked about) running, but
changing the web.xml to follow the spec (using the schema rather than the
old 2_3 DTD) has cleared up a whole slew of strange behaviour.  Suddenly
everything works as as it appears in the docs, error messages are helpful,
etc etc...

Cheers,
Andrew


Rahul Akolkar said:
> On 11/1/05, andrew cooke <an...@acooke.org> wrote:
>>
>> 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?
>>
> <snip/>
>
> A Servlet 2.4 web application descriptor, most likely.
>
> -Rahul
>
>
>> 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
> <snap/>
>
> ---------------------------------------------------------------------
> 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


Re: Passing values to tags [Was: Passing typed (non-String) data to tag file - error in getValueFromPropertyEditorManager]

Posted by Rahul Akolkar <ra...@gmail.com>.
On 11/1/05, andrew cooke <an...@acooke.org> wrote:
>
> 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?
>
<snip/>

A Servlet 2.4 web application descriptor, most likely.

-Rahul


> 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
<snap/>

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