tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Deerwester <sc...@HK.Super.NET>
Subject Servlet as ""???
Date Wed, 01 Mar 2000 01:35:33 GMT
I have a Tomcat servlet that acts as a filtering proxy server for a
particular site. It performs some minor scrubbing on the content from
the real Web site, which it forwards to the client. The problem is that
it needs to respond to and pass on ANY valid URL on the real site...
AFAIK, a Tomcat servlet must be referred to as

either in the standalone server or when hooked up to Apache via JServ,
where /other/info is available to the servlet in the
HttpServletRequest.getRequestURI(). But what I need is for:


to call the servlet directly with "/other/info" passed along in
getRequestURI(). Defining a VirtualHost in Apache's httpd.conf doesn't
help, because the DocumentRoot is a physical file location, not a
logical location. So I can't do something like:

                         ServerName =
                         DocumentRoot = /myservlet/servlet/aservlet

The problem is, the client will be given absolute URL's on the real host
which, for technical reasons, the servlet will not be able to intercept
and modify (the content isn't HTML). So I have the following:

Client: ->
Servlet: ->
Server:   "...; var=/nutherPage; url=http:$var; ..." ->
Servlet:  "...; var=/nutherpage; url=http:$var; ..." ->
Client: ->
Servlet:  ???

and, of course, "" doesn't exist. The only
obvious solution seems to me that the servlet be addressable as


which I don't know how to do. I've tried putzing with virtual hosts in
Apache, and with the servlet and Tomcat server configurations, but I'm
stumped. Can anybody help?


View raw message