You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by jfc <jf...@btopenworld.com> on 2002/09/01 20:16:42 UTC
altering the request URI in a filter
Hi,
Tomcat 404, jdk1.3:
Is it possible to alter the request's URI after authentication but
before the request is delegated to a Struts action mapping?
I would like to be able to strip a string from the request URI which is
there solely for the purposes of enforcing the web container to obtain
authentication and authorization info. (if the web container's auth
cache has been turned off).
Cheers
jfc
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: altering the request URI in a filter
Posted by jfc <jf...@btopenworld.com>.
Bill Barker wrote:
>"jfc" <jf...@btopenworld.com> wrote in message
>news:3D72598A.8010704@btopenworld.com...
>
>>Hi,
>>
>>Tomcat 404, jdk1.3:
>>
>>Is it possible to alter the request's URI after authentication but
>>before the request is delegated to a Struts action mapping?
>>
>
>The beauty of Filters is that anything is possible :-). The Filter (at
>least under Tomcat) will only be invoked after authentication, but before
>the Struts servlet.
>
>>I would like to be able to strip a string from the request URI which is
>>there solely for the purposes of enforcing the web container to obtain
>>authentication and authorization info. (if the web container's auth
>>cache has been turned off).
>>
>
>You would need to wrap the Request with one that over-rides (at least)
>getRequestURI, and getServletPath, and in some cases, getPathInfo (although,
>since Struts uses extension mappings, the last one shouldn't apply in your
>case).
>
>>Cheers
>>jfc
>>
>
>
>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
Hi,
Thanks for the reply. How can I actually set the new value/s on the
request? I don't see any setter methods or any fields which can be used
to hold the new value.
The only setters I can see are setAttribute and setRequest.
jfc
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: altering the request URI in a filter
Posted by Bill Barker <re...@verizon.net>.
"jfc" <jf...@btopenworld.com> wrote in message
news:3D72598A.8010704@btopenworld.com...
> Hi,
>
> Tomcat 404, jdk1.3:
>
> Is it possible to alter the request's URI after authentication but
> before the request is delegated to a Struts action mapping?
The beauty of Filters is that anything is possible :-). The Filter (at
least under Tomcat) will only be invoked after authentication, but before
the Struts servlet.
>
> I would like to be able to strip a string from the request URI which is
> there solely for the purposes of enforcing the web container to obtain
> authentication and authorization info. (if the web container's auth
> cache has been turned off).
You would need to wrap the Request with one that over-rides (at least)
getRequestURI, and getServletPath, and in some cases, getPathInfo (although,
since Struts uses extension mappings, the last one shouldn't apply in your
case).
>
> Cheers
> jfc
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>