You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Glenn Atter <ga...@oxmol.co.uk> on 2000/03/30 14:47:58 UTC

Potential Bug associated with Apache and URL Rewrites

Hi Folks,

I have been using tomcat and apache for the last 4-5 months. However, only
recently I have come across the need to send the results of a JSP page back
to the browser with a different file type extension.

I thought the best way to do this was to use the rewrite module in apache to
append .jsp to a number of files requested by the browser. However, I am
running into a few problems, tomcat tries to access the original URI instead
of the rewritten URI. This results is a 404 error because tomcat cannot find
the file.

I have looked into the code and it appears that the requestURI obtained via
the Ajp12 connector is the original URI and not the rewritten URI. Upon
further inspection the rewritten URI is not being completely ignored and is
actually being passed through to tomcat in script_name variable. This
variable is currently being ignored.

Any comments?

Glenn


Setting cookies in my RequestInterceptor

Posted by Nigel Lui <ni...@standardinfo.com>.
Hi,

I implemented a class that extends BaseInterceptor, and register it
in my server.xml as:
<RequestInterceptor className="com.stdinfo.tomcat.SecurityCheck" />

In the class above, I override the method
public int authenticate( Request request, Response response )
Inside that method, I tried to set cookies thru the interface Response by
using
response.addCookie(cookie);

The problem is my cookie never get to my browser cause the headers are
resetted by the method reset() in the class
org.apache.tomcat.core.ResponseImpl.java

Am I not doing it right, or is there a way to get around it?

Thanks,

-- nl






Re: Potential Bug associated with Apache and URL Rewrites

Posted by Jan Labanowski <jk...@osc.edu>.
Dear Glenn

You may want to look at my installation notes for Apache/Tomcat at
  http://www.ccl.net/cca/software/UNIX/apache/READMEJ1LB.txt
I had a similar problem with rewrite, and you need to change the
mod_rewrite/mod_jserv Loading/Adding schedule. Look me up,
it may help.


On Thu, 30 Mar 2000, Glenn Atter wrote:

> Hi Folks,
> 
> I have been using tomcat and apache for the last 4-5 months. However, only
> recently I have come across the need to send the results of a JSP page back
> to the browser with a different file type extension.
> 
> I thought the best way to do this was to use the rewrite module in apache to
> append .jsp to a number of files requested by the browser. However, I am
> running into a few problems, tomcat tries to access the original URI instead
> of the rewritten URI. This results is a 404 error because tomcat cannot find
> the file.
> 
> I have looked into the code and it appears that the requestURI obtained via
> the Ajp12 connector is the original URI and not the rewritten URI. Upon
> further inspection the rewritten URI is not being completely ignored and is
> actually being passed through to tomcat in script_name variable. This
> variable is currently being ignored.
> 
> Any comments?
> 
> Glenn
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 

Jan K. Labanowski            |    phone: 614-292-9279,  FAX: 614-292-7168
Ohio Supercomputer Center    |    Internet: jkl@osc.edu 
1224 Kinnear Rd,             |    http://www.ccl.net/chemistry.html
Columbus, OH 43212-1163      |    http://www.osc.edu/