Hi, all,
I run into an error message on Tomcat 4.0.4b2 when I use a custom tag in a JSP file.
The error message is:
/jsp/fullsearchlist/content.jsp(4,0) Unable to find setter method for attribute:
numItems
The code fragment is the followings:
public abstract class ListTag extends
I don't know if this is the desired answer, and don't have time to think
about the Java language issues here, but a quick fix would be to change:
protected int numItems = -1;
to
private int numItems = -1;
Then remove the overrides from Search and FullSearch classes. Then ensure
that all
Thanks very much, Philip for your quick response.
You are right. Theoretically, the numItems should be declaimed as a private but not
protected attribute. I, however,
don't think that is the cause, but why the TC keeps a blind eye on the setter method.
The fragment of code is based on
Are you just running the pet store example, cold or with your own edits?
how old is it? You must be running tomcat 4, right? maybe the example is
for 3, although in theory most stuff is backward compatible...
Also, it might help of course to see some jsp -- I assume you're already
doing
I don't run the PetStore at all, but use a small portion of the framework with a litte
modification. I don't observe any
compatible problem other than the tag names changed in the new tld file.
Here is the jsp file.
~
%@ page contentType='text/html; charset=UTF-8' %