This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes Tag Attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Tag Attributes" Watch "Tag Attributes" New topic
Author

Tag Attributes

Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
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 ]

=================================<br /> Rafael U. C. Afonso<br /> <a href="http://www.javafree.com.br" target="_blank" rel="nofollow">www.javafree.com.br</a><br />=================================<br /><i>Where is debug?<br />debug is on the table</i>
Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
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

Joined: Mar 22, 2000
Posts: 12933
    
    5
Try making the String test access modifier "public".
[ October 19, 2002: Message edited by: William Brogden ]
Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
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,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tag Attributes