Philip Weaver wrote:
>
> Whenever I use my taglib from within the subdirectory "pages", for example,
> jasper complains that "Class pages.SpecialConnectionTag not found in type
> declaration." So, it appears to find the taglib but thinks that it's part of
> a package? (which it's not)
>
> I can work around this by keeping everything in one directory but how do I
> solve this? I don't have the problem using the same pages in Resin so this
> could be a configuration problem with Tomcat. Please help.
>
> Thanks,
> Philip
>
> org.apache.jasper.JasperException: Unable to compile class for
> JSP/Organize/Tomcat/jakarta-tomcat-3.2.1/work/localhost_8080%2Fphilmaker/_00
> 02fpages_0002findex_0002ejspindex_jsp_0.java:71: Class
> pages.SpecialConnectionTag not found in type declaration.
> SpecialConnectionTag _jspx_th_pjw_specialconnection_0 = new
> SpecialConnectionTag();
> ^
> /Organize/Tomcat/jakarta-tomcat-3.2.1/work/localhost_8080%2Fphilmaker/_0002f
> pages_0002findex_0002ejspindex_jsp_0.java:71: Class
> pages.SpecialConnectionTag not found in type declaration.
> SpecialConnectionTag _jspx_th_pjw_specialconnection_0 = new
> SpecialConnectionTag();
>
> ^
> 2 errors
>
> at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
This has to do with how Java deals with classes that are not part of a package
in a class that *is* part of a package (like the class generated from the JSP
page). It's the same problem as I describe for JavaBeans in this article:
<http://java.oreilly.com/news/jsptips_1100.html>
The solution is simple: make the tag handler part of a package.
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets