File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes AdvisorTagHandler unable to compile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "AdvisorTagHandler unable to compile" Watch "AdvisorTagHandler unable to compile" New topic
Author

AdvisorTagHandler unable to compile

Reidar Gjerstad
Greenhorn

Joined: Dec 02, 2008
Posts: 19
Dear Sirs

I am testing out one of the examples in HFSJ for a custom tag handler.


JSP looks like this:


The simple tag handler looks like this



...and my TLD looks like this, placed in WEB-INF:




The .java file compiles, but when I try to access the jsp I get an exception report with following:



It appears as though the container expects me to implement all methods in the interface Tag when all I want to do is extend the class SimpleTagSupport.

My server is Apache Tomcat/6.0.14. JSP version is 2.0 (or at least it came with Tomcat).

I would appreciate any advice.

This is not urgent ;-)

Cheers
Reidar
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

Is your web.xml declared properly as a Servlets 2.4 (or 2.5) application? Or does it use the 2.3 DTD?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Reidar Gjerstad
Greenhorn

Joined: Dec 02, 2008
Posts: 19
Hi Bear

My web.xml is using Servlets 2.4. I tried to change to 2.5 since Tomcat 6.0 seems to require 2.5. I stopped and restarted Tomcat. No change in behavior. Tried several times.

Here's the XSD (XML Schema Definition) part of my web.xml, now using 2.5:



This starts to bug me since I try to study for the exam.

Any other ideas?

Cheers
Reidar Gjerstad
Greenhorn

Joined: Dec 02, 2008
Posts: 19
Hi again

I solved the problem. I had a copy of jsp-api.jar in my ...appname\WEB-INF\lib directory. jsp-api.jar does indeed contain the class SimpleTagSupport. Removing jsp-api.jar solved the problem. Probably it was copied there during earlier troubleshooting.

Thanks for patience.

Cheers
Reidar
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

Oy!!!

Yes, having jsp-api.jar in your WEB-INF/lib can cause all sorts of problems. This is not one that I've seen before (others happen often enough that it's easy to recognize them).
ar sah
Greenhorn

Joined: Jun 26, 2009
Posts: 1
[Thread hi-jack removed. Please as your own questions in your own topics.]


www.wasserbettenhife.com
schoolies
boy-zh kaisa
Greenhorn

Joined: Sep 08, 2009
Posts: 1
Reidar Gjerstad wrote:Hi again

I solved the problem. I had a copy of jsp-api.jar in my ...appname\WEB-INF\lib directory. jsp-api.jar does indeed contain the class SimpleTagSupport. Removing jsp-api.jar solved the problem. Probably it was copied there during earlier troubleshooting.

Thanks for patience.

Cheers
Reidar

thank you very much.Although i am from china.
lakshmanan anand
Greenhorn

Joined: Jan 13, 2009
Posts: 22
Reidar Gjerstad wrote:Hi again

I solved the problem. I had a copy of jsp-api.jar in my ...appname\WEB-INF\lib directory. jsp-api.jar does indeed contain the class SimpleTagSupport. Removing jsp-api.jar solved the problem. Probably it was copied there during earlier troubleshooting.

Thanks for patience.

Cheers
Reidar


but how can the class that extends SimpleTagSupport be built without adding jsp-api.jar to the build path. We need that class to create our tag support class. Something is going wrong


http://luckydev07.blogspot.com
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

lakshmanan anand wrote:but how can the class that extends SimpleTagSupport be built without adding jsp-api.jar to the build path. We need that class to create our tag support class. Something is going wrong

This has nothing to do with the build path. WEB-INF/lib is part of the run-time path -- not the build path.

The container provides the servlet and JSP APIs. Copying the jar file to WEB-INF/lib causes all manner of problems such as those discussed here. Don't do it.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AdvisorTagHandler unable to compile