tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Gemborys <>
Subject How jasper determines when to use default package org.apache.jsp when translating jsps to servlets?
Date Thu, 20 Nov 2003 21:08:21 GMT
Tomcat 4.1/Windows XP

I am working on the ant script that should precompile all jsp pages
for a given web application. I used build.xml from Tomcat documentation 
as starting point. After running ant I found that some of the translated 
and compiled jsp pages are not working.

For some reason when the jsp pages are translated/compiled by 
tomcat/jasper runtime the generated servlets sometimes contain package 
statement set to the default package like:
package org.apache.jsp;

and sometimes the generated servlet's package statement is determined 
based on the physical location of the jsp page in the web application tree.

The build.xml I created always updates generated servlets with the
package statement based on the jsp location in the web application 
directory tree.


For the jsp located in <webapp>/agentHome the build.xml outputs package 

package agentHome;

which causes exception

javax.servlet.ServletException: org/apache/jsp/nbpDefault_jsp (wrong
name: layouts/nbpDefault_jsp)
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(

If the package statement is replaced with


Everything works.

Any suggestions?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message