tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
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
> /ABC/DEF
> 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

...
(now)
Apache things are in directory
/opt/test/htdocs
tomcat things are in directory
/opt/test/servlet

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

And jsp are stored in
/opt/test/servlet/jsp/Viewer/View.jsp
...

end quote

and he didn't say -- but I presume --, that web.xml is in
/opt/test/servlet/WEB-INF/web.xml


So, Petr, to bring all this together :

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

docBase="/opt/test/servlet"

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 :

docBase="/opt/test/servlet"

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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message