Hello Folks, I am using a JSP with the following code
This JSP declares and tries to use a tag file named "includeparam.tag" which is in the /WEB-INF/tags directory whose code is as given below code of includeparam.tag:
While trying to view the JSP, i am getting the following exception: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JasperException: Unable to find setter method for attribute: custom ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NOTE: Though I am able to see the page without any problem if I remove that attribute directive in the tag file and from the tag in the JSP.
I am running this on tomcat 5.0.16 with JSTL version 1.1 Please help me out by telling me whats the error and how do i correct it.
The problem was a very trivial one so I didnt care to post the solution. Anyway, the problem was that initially I had created the tag file without any attributes and called it without giving any attributes in the JSP.
Later I added an attribute "custom" to the tag file and provided the attribute in the call to the tag file in the JSP after which I got this exception.
It appears that the tag files are created as java classes in a folder called "tags" in the temporary working directory(the one used to generate java and class files for the JSPs). After I added the attribute, the container wasnt recompiling the tag files to create new versions of java and class files for it but it recompiled the JSP. So effectively, the JSP was passing the attribute but the old version of the compiled tag files didnt accept any attributes hence the exception "unable to find setter method".
Once I cleared the temporary folder and issued a fresh request, everything got compiled and it worked fine.
Hope this explanation is sufficient and helpful for beginners like me
In case I am not clear in whatever I just explained, kindly let me know. I'll be glad to help.