tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olenin, Vladimir" <vladimir.ole...@globeinteractive.com>
Subject RE: Request redirect
Date Wed, 04 Jul 2001 22:49:16 GMT
> Do some research into RequestInterceptors.  They can be very handy. You
could also write a servlet for this but that
> would be using a sledge hammer to swat a fly(so to speak).
Well, I would have gone even for a 'sledge hammer' solution, but I think it
won't work exactly for the reasons I outlined - the request, as I can
understand from the docs, can be forwarded at most to the same machine and
to smth, running inside the same WebServer. Eg, in Servlet API for
getContext it is written:

-------
This method allows servlets to gain access to the context for various parts
of the server, and as needed obtain RequestDispatcher objects from the
context. The given path must be absolute (beginning with "/") and is
interpreted based on the server's document root.
-------

and I don't want to be binded to server's document root anyhow. In other
words, I want to do this (from Tomcat 4.0 docs):

-------
Proxy support can take many forms. The following outline assumes that you
are running Tomcat behind an Apache web server (listening to port 80) on the
same server that Tomcat is running on, and you wish to have all requests
flow through Apache, but forward requests for a particular web application
to Tomcat for processing.

Configure your copy of Apache so that it includes the mod_proxy module. If
you are building from source, the easiest way to do this is to include the
--enable-module=proxy directive on the ./configure command line. 
Include two directives in your httpd.conf file for each web application that
you wish to forward to Tomcat. For example: 
        ProxyPass         /myapp  http://localhost:8081/myapp
        ProxyPassReverse  /myapp  http://localhost:8081/myapp
    
tells Apache to forward all requests sent to URLs like
http://localhost/myapp/* to be forwarded the Tomcat connector listening on
port 8081. 
-------

with only difference that instead 'Apache' in the text above 'Tomcat' should
stay, and instead of 'Tomcat' - 'HTTP push' daemon. Is it possible with
Tomcat (I guess it should be since as far as I understand Tomcat is mostly
'compatible' with Apache in the part of serving static HTTP requests).
Thanks again,

vladimir

-----Original Message-----
From: Michael Wentzel [mailto:Michael.Wentzel@aswethink.com] 
Sent: 04 July 2001 17:46
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Request redirect


> I've been trying to find the answer to my question in mail
> archieve, but
> failed, so, hope, someone could help me. The question is how 
> to make Tomcat
> redirect some requests to another program, lets say an HTTP 
> daemon, running
> on a separate (or the same) workstation (it would be a Java 
> application
> listening for HTTP connections). Tomcat might redirect HTTP 
> request based on
> practically anything - it's not very important for me - some 
> field in HTTP
> header, URL parameter value or just some particular URL. As 
> far as I know
> Apache server can do redirection of HTTP request to another 
> services based
> on URL string (that's what I saw in docs for Tomcat 4.0). And 
> as far as I
> remember Microsoft IIS can do that as well. So, what about 
> Tomcat? I guess
> server.xml file should be modified (<Connector> section?), 
> but nothing about
> such capability is written in the docs.

Do some research into RequestInterceptors.  They can be very handy. You
could also write a servlet for this but that would be using a sledge hammer
to swat a fly(so to speak).


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

Mime
View raw message