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 13:29:20 UTC

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

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