Bug 53473

Summary: Error in isVirtualWebappRelative param configuration
Product: Tomcat 7 Reporter: Giorgio Giudetti <g.giudetti>
Component: DocumentationAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Giorgio Giudetti 2012-06-27 08:35:42 UTC
The docs for the 'isVirtualWebappRelative' param configuration state that '0' or '1' is the accepted setting:

web.xml and ssi-howto:
<!--   isVirtualWebappRelative                                            -->
<!--                       Should "virtual" paths be interpreted as       -->
<!--                       relative to the context root, instead of       -->
<!--                       the server root?  (0=false, 1=true) [0]        -->

but the code that reads the parameter is:

org/apache/catalina/ssi/SSIServlet.java: 
isVirtualWebappRelative = Boolean.parseBoolean(config.getInitParameter("isVirtualWebappRelative"));


org/apache/catalina/ssi/SSIFilter.java:
isVirtualWebappRelative = Boolean.parseBoolean(getServletConfig().getInitParameter("isVirtualWebappRelative"));

As of that code, the only working configuration to set the 'isVirtualWebappRelative' to true is:

<init-param>
          <param-name>isVirtualWebappRelative</param-name>
          <param-value>true</param-value>
</init-param>

and not

<init-param>
          <param-name>isVirtualWebappRelative</param-name>
          <param-value>1</param-value>
</init-param>
Comment 1 Mark Thomas 2012-06-27 19:39:46 UTC
Thanks for the report. Fixed in trunk and 7.0.x and will be included in 7.0.29 onwards.
Comment 2 Konstantin Kolinko 2012-06-28 06:03:03 UTC
Fixed in 6.0 as well with r1354820 and will be in 6.0.36.

Note: int value for this option is used by Tomcat 5.5, so no fix there is needed
in SSIFilter, SSIServlet of 5.5.x:
isVirtualWebappRelative = Integer.parseInt(value) > 0?true:false;