Bug 36191 - Including JSP's changes working directory
Summary: Including JSP's changes working directory
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_include (show other bugs)
Version: 2.0.54
Hardware: Other other
: P2 major (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2005-08-15 09:40 UTC by Tom Scholten
Modified: 2005-12-05 22:56 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Tom Scholten 2005-08-15 09:40:13 UTC
Adding to the headers of the bug;
Apache 2.0.54 was used with mod_jk 1.2.13 on Redhat 9

*Filed also under apache/mod_include again. Also filed under mod_jk as Bug #36121*


One of our customers uses SSI (mod_include) to include their jsp's

eg file index.shtml (located in /web/customer/www)
<!--#include virtual="top.html"-->
<!--#include virtual="active/news.jsp?${QUERY_STRING}"-->
<!--#include virtual="bottom.html"-->

What happens is that "top" and "news" are displayed correctly, but bottom fails
with "[an error occurred while processing this directive]". If we move the
include of "bottom.html" above the jsp line it works (besides from the webpage
not displaying as desired :)

The errorlog contains the following lines after requesting the page from apache;
File does not exist: /web/customer/www/active/bottom.html
unable to include "bottom.html" in parsed file /web/customer/www/index.shtml

If found Bug #34232 mentioning the same, but it was discarded as being apache
and/or mod_include. I didn't find any references to a new(er) ticket in ASF. The
current workaround for our customer would be to update their files to 'include
virtual="../bottom.html"' or revert back to their original "exec cgi" statements
(which worked, but we agreed with them upon that being deprecated).

For some reason the "include virtual" (or include file which causes the same)
that executes the 'jsp' sets the current working directory to "active" instead
of going 'back' to the directory where index.shtml was parsed from.

Any suggestions or options are welcome,

Comment 1 Nick Kew 2005-08-15 17:10:55 UTC
You could resolve this.  What do you get with: 
<!--#include virtual="top.html"--> 
<!--#include virtual="active/something-static.html"--> 
<!--#include virtual="bottom.html"--> 
If that does the same, you can infer it's mod_include changing its path.  If 
it works correctly, you infer it's another module (the one doing jsp) 
modifying a read-only field in the request_rec. 
Comment 2 Tom Scholten 2005-08-15 19:48:46 UTC
(In reply to comment #1)
> You could resolve this.  What do you get with: 
> *snap*
> it works correctly, you infer it's another module (the one doing jsp) 

So as with the previous bug (Bug #34232) its with mod_jk then i guess, putting
my hopes up that someone will solve it over there. Thanks!

Comment 3 Paul Querna 2005-12-06 07:56:38 UTC
mod_jk bug.