tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Cobban" <jcob...@magma.ca>
Subject Re: Why can I not use attributes "lang" and "maxRows" in a custom tag
Date Sat, 23 Nov 2002 16:17:50 GMT
----- Original Message -----
From: "Jan Luehe" <Jan.Luehe@Sun.COM>
Subject: Re: Why can I not use attributes "lang" and "maxRows" in a custom
tag


> > Tomcat 4.1.12 does not accept a custom tag with attributes "lang"
> > or "maxRows".  When I asked about this on the Tomcat users list I was
> > informed that it also does not accept the attribute "class".
> >
> > Specifically if I define those attributes then when the jsp is compiled
I
> > get an "unable to find setter" error.  If I replace them with similar
but
> > meaningless attribute names the page compiles correctly.
>
> This can't be true. For example, JSTL defines an attribute
> named 'maxRows' for its <sql:query> action.
> I am not aware of any naming restrictions for custom tag attributes.
>
> Are you sure the tag handler for your custom action
> defines an approriate setter method for the attributes in
> question?

I kept experimenting and found exactly what it was that Tomcat disliked
about my attribute.  It was not the name.  It was not the presence or
absence of the set method.  It was that there was also a get method which
did not return String!  Since Tomcat does not use the get method I do not
understand why it cares whether or not one is present or what its signature
is.  But as soon as I change the name of the get method so it did not match
the set method Tomcat merrily accepted the tag.

For me this is now an issue of documentation.  I have searched the JSP 1.2
spec using every term I can think of and I cannot find where it specifies
the characteristics of the set method for an attribute on a custom tag.  I
have therefore been depending upon the description of this capability in
Marty Hall's book.  If the JSP specification, and Tomcat, have a legitimate
reason for looking at the characteristics of the get method when deciding
whether or not to use the set method, then that should be documented.
Otherwise the behavior is frankly mysterious.

Thank you for responding.  When a week went by without a response I
unsubscribed from the list, so the CC on this message may be discarded.


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message