  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | JspServlet classpath init param is ignored | JspServlet classpath init param is ignored 2006-12-14 - By werner loibl [celumsolutions]
Back Hi,
I am trying to set a custom classpath for the JspServlet to allow JSPs to reference classes that are not located in one of the default locations (WEB-INF/classes, WEB-INF/lib). But I can't get this to work, it seems JspServlet ignores the servlet init param. From looking into the sources it seems that the init param is read and remembered but never accessed or used later on in the JSP compilation process (though I'm not absolutely sure since I am not familiar with the tomcat code base at all). I tried both the JDTCompiler and the AntCompiler. I tested with tomcat 5.5.20.
Does anyone know whether the classpath init param is meant to work resp. to be used in this situation?
Thanks for your help!
Werner
This is my web.xml
<?xml version="1.0" encoding="UTF-8 (See http://UTF-8.ora-code.com)"?> <web-app version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" xmlns="http://java.sun.com/xml/ns/j2ee" <http://java.sun.com/xml/ns/j2ee> xmlns:web="http://java.sun.com/xml/ns/j2ee" <http://java.sun.com/xml/ns/j2ee> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <http://www.w3.org/2001/XMLSchema-instance> > <servlet> <servlet-name>jsp</servlet-name> <servlet-class>org.apache.jasper.servlet.JspServlet </servlet-class> <init-param> <param-name>fork</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>xpoweredBy</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>classpath</param-name> <param-value>file:/X:/lib/plugin.jar <file:///X:/lib/plugin.jar> </param-value> </init-param> <init-param> <param-name>compiler</param-name> <param-value>javac1.5</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> </web-app>
This is my test JSP. DummyOutput is a simple test class
<%@ page import="test.*" %> <% new DummyOutput().doMagic(); %>
|
|
 |