Bug 37143

Summary: Jasper precompiler didn't handle external entities
Product: Tomcat 5 Reporter: Henri Gomez <hgomez>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 5.5.12   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Henri Gomez 2005-10-18 14:46:08 UTC
Jasper has been updated sometimes ago to handle correctly external entities
included from web.xml when this entities live in the WEBAPP, but in precompiling
stage it didn't detect them.

here is a sample web.xml 

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd" [ 

<!ENTITY base      SYSTEM "base-tc55.xml">
<!ENTITY jsp SYSTEM  "jsp.xml">
]>

<web-app>
  <display-name>MyApp</display-name>
  <context-param>
    <param-name>MyReleaseDate<param-name>
    <param-value>20051018</param-value>
  </context-param>

  <servlet>
    <servlet-name>startup</servlet-name>
    <servlet-class>org.domain.web.StartupServlet</servlet-class>
    <init-param>
      <param-name>myParm</param-name>
      <param-value>myValue</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

&base;
&jsp;

  <session-config>
    <session-timeout>30</session-timeout>
  </session-config>
 </web-app>

the base.xml could be :

<?xml version="1.0" encoding="ISO-8859-1"?>

  <servlet>
    <servlet-name>login</servlet-name>
    <servlet-class>org.domain.web.LoginServlet</servlet-class>
    <init-param>
      <param-name>stand.alone</param-name>
      <param-value>true</param-value>
    </init-param>

  </servlet>
  
  <servlet>
    <servlet-name>logout</servlet-name>
    <servlet-class>org.domain.web.LogoutServlet</servlet-class>
    <init-param>
      <param-name>demo</param-name>
      <param-value>true</param-value>
    </init-param>
  </servlet>


and a sample jsp.xml :

<?xml version="1.0" encoding="ISO-8859-1"?>
Comment 1 william.barker 2005-11-07 04:17:46 UTC
AFAIK, these are the only two places where web.xml is parsed.

*** This bug has been marked as a duplicate of 37261 ***