• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tag Attributes

 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
I have a tag called "Validate". I added a attribute called "message". In tag definition java file I created its setter method:

In TLD File I added this definition:

And in JSP File my tag is in this form:

When I run my Tomcat to rum my jsp file, Tomcat return this error message:

org.apache.jasper.compiler.CompileException: /jsp/validate.jsp(9,0) Unable to find setter method for attribute: message

Someone can explains this???
Thanks
[ October 19, 2002: Message edited by: Rafael Afonso ]
 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again:
I took a example tag from Utility Tag Library from Jakarta project. It is the Hello Tag. Originally this tag has no attributes. So I added a new attribute. The tag source code is below:

The TLD file is below:

And my JSP page is above:

Anyway, when I run this page in Tomcat I got the same message:

org.apache.jasper.compiler.CompileException: /jsp/Hello.jsp(9,3) Unable to find setter method for attribute: test

Again: What must I do?
thanks,
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try making the String test access modifier "public".
[ October 19, 2002: Message edited by: William Brogden ]
 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again:
It was all my fails!!
First, about my second message, in class Hello I didn't put a method called public void setTest(String test), but public void test(String test).
Second, about my first message: I am using a buildfile ant script. I was executing only the "build" target. But I think that my modifications was not recorded in jar file, because I dicovered that I must first execute the "clean" target to clean jar files and directories, my modifications was recorded and I could see them when I runned JSP pages. I don't understand this behavior from Ant. But anyway I am more relieved.
Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic