I have a configuration where Tomcat is front by Apache.
I have a servlet that is mapped to the all path under the webapp root context (e.g) :
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
This would effectively trap all requests to be serviced by MyServlet.
I would like for MyServlet to detect the request coming in , and if it is a PHP request , reroute the whole request (including request parameters and session) to be handled by PHP engine (or perhaps , hit Apache which have PHP installed). Is there a way to do this ?
By doing a servlet redirect or dispatch is definitely not working as it will cause an infinite loop!
Thanks !
Kean
-
Servlet rerouting request to PHP interpreter (3 messages)
- Posted by: Oon Kean Lin
- Posted on: February 19 2004 03:40 EST
Threaded Messages (3)
- tomcat and apache by Matt George on February 19 2004 11:22 EST
- tomcat and apache by Oon Kean Lin on February 20 2004 09:19 EST
- tomcat and apache by Dmitry Namiot on February 21 2004 05:36 EST
- tomcat and apache by Oon Kean Lin on February 20 2004 09:19 EST
-
tomcat and apache[ Go to top ]
- Posted by: Matt George
- Posted on: February 19 2004 11:22 EST
- in response to Oon Kean Lin
If I understand correctly, you have Apache on the frontend, and it forwards requests to tomcat. You should be able to configure apache to forward everything to tomcat, but keep all php requests for itself. If that is not a valid option, then another thing to do is to redo your servlet mapping or to handle the forward inside your servlet. -
tomcat and apache[ Go to top ]
- Posted by: Oon Kean Lin
- Posted on: February 20 2004 09:19 EST
- in response to Matt George
Unfortunately I do not have access to Apache , hence I would not be able to do any tweaking to it.
I am actually looking at the last option og handling the forward in the servlet. But how can I do that without ending up in a recursive call ? -
tomcat and apache[ Go to top ]
- Posted by: Dmitry Namiot
- Posted on: February 21 2004 17:36 EST
- in response to Oon Kean Lin
See for example Redirect filter in JSOS:
http://www.servletsuite.com/servlets.htm
There is no infinite loop.