You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Cobban <jc...@magma.ca> on 2002/11/15 03:55:40 UTC
Unable to find setter method for attribute: maxRows
Hello!
Is there anyone out there?
I have tried twice to subscribe to this mailing list and I have not received
ANY traffic from it. Meanwhile I keep having problems with Tomcat not being
able to find my setter methods for attributes.
I cannot get Tomcat to accept tag classes where the setter method is
implemented in a base class. I have to put the setter method into every
derived class, which sort of defeats the point. However now I have run into
a situation where even that does not work.
I have an attribute "maxRows". According to my reading of the documentation
that says the setter method should be "setMaxRows". But I have such a
method and I am still getting the "Unable to find setter method for
attribute: maxRows" error message.
This is with Tomcat 4.0.3.
The relevant line in the .jsp is:
<census:subdivq lang="EN" maxRows="999">
The tag definition in the TLD is:
<tag>
<name>subdivq</name>
<tagclass>Census.tags.QuerySubDivTag</tagclass>
<bodycontent>JSP</bodycontent>
<info>Performs a query of the census subdivision table based upon the
parameters supplied in the request URL</info>
<attribute>
<!-- this attribute indicates the language to be used for text
displayed to the user -->
<name>lang</name>
<required>false</required>
</attribute>
<attribute>
<!-- this attribute indicates the maximum number of rows to
display -->
<name>maxRows</name>
<required>false</required>
</attribute>
</tag>
The class contains the definition:
public class QuerySubDivTag extends QueryTag
{
...
public void setMaxRows(String repeats)
{
super.setMaxRows(repeats);
}
Jim Cobban jcobban@magma.ca
34 Palomino Dr.
Kanata, ON, CANADA
K2M 1M1
+1-613-592-9438
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Unable to find setter method for attribute: maxRows
Posted by Kwok Peng Tuck <pe...@makmal.com>.
Yes I'm getting your traffic.
Jim Cobban wrote:
>Hello!
>
>Is there anyone out there?
>
>I have tried twice to subscribe to this mailing list and I have not received
>ANY traffic from it. Meanwhile I keep having problems with Tomcat not being
>able to find my setter methods for attributes.
>
>I cannot get Tomcat to accept tag classes where the setter method is
>implemented in a base class. I have to put the setter method into every
>derived class, which sort of defeats the point. However now I have run into
>a situation where even that does not work.
>
>I have an attribute "maxRows". According to my reading of the documentation
>that says the setter method should be "setMaxRows". But I have such a
>method and I am still getting the "Unable to find setter method for
>attribute: maxRows" error message.
>
>This is with Tomcat 4.0.3.
>
>The relevant line in the .jsp is:
>
> <census:subdivq lang="EN" maxRows="999">
>
>The tag definition in the TLD is:
>
> <tag>
> <name>subdivq</name>
> <tagclass>Census.tags.QuerySubDivTag</tagclass>
> <bodycontent>JSP</bodycontent>
> <info>Performs a query of the census subdivision table based upon the
> parameters supplied in the request URL</info>
> <attribute>
> <!-- this attribute indicates the language to be used for text
> displayed to the user -->
> <name>lang</name>
> <required>false</required>
> </attribute>
> <attribute>
> <!-- this attribute indicates the maximum number of rows to
>display -->
> <name>maxRows</name>
> <required>false</required>
> </attribute>
> </tag>
>
>
>The class contains the definition:
>
>public class QuerySubDivTag extends QueryTag
>{
>...
> public void setMaxRows(String repeats)
> {
> super.setMaxRows(repeats);
> }
>
>Jim Cobban jcobban@magma.ca
>34 Palomino Dr.
>Kanata, ON, CANADA
>K2M 1M1
>+1-613-592-9438
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Unable to find setter method for attribute: maxRows
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Thu, 14 Nov 2002, Jim Cobban wrote:
>
> I cannot get Tomcat to accept tag classes where the setter method is
> implemented in a base class. I have to put the setter method into every
> derived class, which sort of defeats the point. However now I have run into
> a situation where even that does not work.
>
This works for me all the time -- for example, nearly all of the Struts
HTML tags are implemented with some attribute setters in base classes of
the actual tag subclasses.
The most likely explanation for your problem is that your classes probably
violate one of the JavaBeans design patterns, which are required for JSP
to recognize your tag handler's properties successfully. The most likely
problems:
* The setMaxRows() method in the base class isn't public.
* Your public setMaxRows() method doesn't take exactly one parameter.
* You have more than one public setMaxRows() method (with a different
parameter type)
The solution to your problem is most likely in the way you have
setMaxRows() defined in your base class -- but, since you didn't quote
that, there's no way to know for sure what is going on.
Craig
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>