tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: JSP pages are not loaded. Only HTML source code
Date Wed, 09 Mar 2011 17:53:48 GMT
Mark Thomas wrote:
> On 09/03/2011 16:02, André Warnier wrote:
>> Now from the train..
>> When you request a URL such as this from Tomcat :
>> (http://hostname)/ABC/DEF/hij.jsp
>> Tomcat uses the first component of the path (/ABC) as mapping for the
>> "web application".
>> It then passes the request to the application "ABC".
> Not strictly correct.
> Tomcat compares the URL to the list of context paths and the longest
> match wins.
> In the example above the context path may be any of the following:
> /
> /ABC
> you simply can't tell from looking at the URL. You have to know what
> context paths are currently configured.

That is certainly more correct than my simplified explanation,
but,at this point, likely to confuse the OP a bit more, maybe ?

Quoting selectively from Petr's previous posts :
in the Catalina configuration directory
(/etc/tomcat5/base/Catalina/localhost/XYtest.xml) is following context

Apache things are in directory
tomcat things are in directory

(/etc/tomcat5/base/Catalina/localhost/)XYtest.xml is now:
<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/opt/test/servlet" allowLinking="true">

And jsp are stored in

end quote

and he didn't say -- but I presume --, that web.xml is in

So, Petr, to bring all this together :

1) in /etc/tomcat5/base/Catalina/localhost/XYtest.xml :


2) in the Apache config :

ProxyPassMatch ^/XYtest/(.*\.jsp)$  ajp://localhost:8009/XYtest/$1

Because if you just use
ProxyPass /XYtest ajp://localhost:8009/Xytest
then a URL like "/XYtest/index.html" will also be passed to Tomcat, and Tomcat will not 
find it, considering the location of your "Apache things" above.

3) in the file index.html :
<frame src="/XyTest/jsp/Viewer/View.jsp" ...

Alternatively, you could do :

1a) in /etc/tomcat5/base/Catalina/localhost/XYtest.xml :


2a) in the Apache config :

ProxyPassMatch ^/XYtest/servlet/(.*)$  ajp://localhost:8009/XYtest/$1

3a) in the file index.html :
<frame src="/XyTest/servlet/jsp/Viewer/View.jsp" ...

(in this case, the ProxyPassMatch directive will "strip" the "/servlet" part, which 
confuses Tomcat)

When (if?) the above is working, then I will suggest a better (and simpler) layout
for the files and directives.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message