Andrew Connick wrote:
I'm having problems with the jsp includes directive where the jsp is in a
sub-directory.
I have 2 subdirectories:
/admin
/segments
index.jsp contains the line <%@ include file="/segments/setup.jsp" %> which is
fine
admin/index.jsp also contains the line <%@ include file="/segments/setup.jsp" %>
This is fine in my test environment, and used to work in my live environment (hosted by an external company) but has recently stopped working.
I suspect the issue is that Tomcat now sees sub-directory /admin as a separate
context. I believe I have proved this by running a simple admin/test.jsp that
displays the results of request.getContextPath(). This shows blank in test and
/admin in live.
Given that it used to work and has now stopped, I think the hosting company
should be able to correct this. However I am having considerable difficulty
with this approach. As I cannot re-create the situation in my testing, I am not
too sure how to proceed.
So, I suppose my real questions are:
- Is the way I have structured my code correct ?
- How do I stop Tomcat treating each sub-directory as a different context (more
specifically, how do Instruct the hosting company) ?
This sounds like you have a setup of the form:
<Host ... appBase=".../webapps/yourApp" ...>
<Context ... docBase="" ... />
</Host>
Is this the case? If you are on an older Tomcat version this will work (due
to a bug that has since been fixed) but it won't work on newer Tomcat
versions. The correct configuration (that works on all Tomcat versions)
should be:
mv .../webapps/yourApp .../webapps/ROOT
<Host ... appBase=".../webapps" ...>
</Host>
HTH,
Mark
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]