Bug 53473 - Error in isVirtualWebappRelative param configuration
Summary: Error in isVirtualWebappRelative param configuration
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Documentation (show other bugs)
Version: unspecified
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-27 08:35 UTC by Giorgio Giudetti
Modified: 2012-06-28 06:03 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;