Bug 41182 - Jasper ignores JspServlet's 'classpath' init param
Summary: Jasper ignores JspServlet's 'classpath' init param
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 5.5.20
Hardware: Other All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-15 07:07 UTC by Werner Loibl
Modified: 2006-12-18 17:28 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Werner Loibl 2006-12-15 07:07:24 UTC
JspServlet describes and reads a servlet init parameter 'classpath'.
Documentation says: 

"classpath - What class path should I use while compiling generated servlets? By
default the classpath is created dynamically based on the current web application."

Current behaviour is that the configured classpath is only considered if no
classpath is configured as servlet context attribute. 

---JspRuntimeContext:335----
String cp = (String) context.getAttribute(Constants.SERVLET_CLASSPATH);
if (cp == null || cp.equals("")) {
  cp = options.getClassPath();
}

It seems that when running within tomcat the context attribute is usually
present and therefore the classpath from the servlet init parameter is not
considered.
Comment 1 Werner Loibl 2006-12-18 02:45:06 UTC
I should add that I put the mapping in the web.xml deployment descriptor of my
webapp, not as part of [tomcatroot]/conf/web.xml. 
Comment 2 Mark Thomas 2006-12-18 17:28:44 UTC
This parameter will never be used when Jasper is used within Tomcat. I have
updated the docs accordingly. The updated docs will be in 5.5.21 onwards.

The reason for this behaviour is that classes required for compilation will
almost certainly be required at runtime so they need to be visible to the web
application's class loader rather than added via this parameter.