You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Young, Pinghua" <pi...@fusionone.com> on 2002/02/09 02:40:51 UTC

Q: JSP compilation fails when JSP page extends from a custom clas s

Can't find this question in FAQ or the archive, so here it goes.  I am
running Tomcat 4.0.1 on Solaris 2.8 with JDK 1.3.1.

I have a very simple JSP page that has the following page directive:

<%@ page info="test.jsp" extends="MySuperJSP" import="net.mime.MySuperJSP"
%>

In the Jasper generated Java file, I find an "import MySuperJSP;" statement
is automatically inserted into the Java file, which causes the JSP
compilation to fail, because MySuperJSP is in net.mime package, instead of
the default package.  I did not find this "import MySuperJSP;" insertion
behavior documented in JSP API 1.2 nor Servlet API 2.3 though.

However, if I change the page directive to be:

<%@ page info="test.jsp" extends="net.mime.MySuperJSP"
import="net.mime.MySuperJSP" %>

Then no gratuitous import statement is added in the generated Java file.

Is this a defect in Tomcat 4.0.1?  Thanks!