Martin Cooper wrote: >OK, I'm confused now. Your original question was about how you could alter >the request URI in a filter. Now, however, you seem to be asking about how >you can alter the request URI in a Struts Action class or in your own >version of the Struts RequestProcessor. What are you really trying to do? > Alter the request URI.
> > >If you want to modify what the request object looks like to everyone, using >a filter, my previous answer applies: Write a request wrapper which returns >a different value than the original from methods such as getRequestURI(). > I only wanted to make sure the change I did (to the request URI) would be visible by whatever struts class does the mapping selection. I didn't know then that using a requestDispatcher would do the trick so I was thinking if it was not possible(to do this using filters) then I might be able to achieve the alteration to the request URI by overriding the appropriate method in the struts request processor. > >If you want to do something inside of Struts, you'll have to make do with >the RequestDispatcher, as someone else suggested. > This I have now done. Thanks for your input ;-) > >-- >Martin Cooper > Any ideas as to how best to slip the string back into the outgoing html's links? What is the best way to do this? Thanks again. jfc > >>-----Original Message----- >>From: jfc [mailto:[EMAIL PROTECTED]] >>Sent: Tuesday, September 03, 2002 6:26 AM >>To: Tomcat Users List >>Subject: Re: altering the request URI in a filter >> >> >>Martin Cooper wrote: >> >>>>-----Original Message----- >>>>From: jfc [mailto:[EMAIL PROTECTED]] >>>>Sent: Monday, September 02, 2002 1:51 AM >>>>To: Tomcat Users List >>>>Subject: Re: altering the request URI in a filter >>>> >>>> >>>[snip] >>> >>>>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. >>>> >>>Since you're the one implementing the wrapper class, you can >>> >>choose to add >> >>>whatever methods you see fit. >>> >>>-- >>>Martin Cooper >>> >>> >>>>jfc >>>> >>>> >>>> >>>>-- >>>>To unsubscribe, e-mail: >>>><mailto:[EMAIL PROTECTED]> >>>>For additional commands, e-mail: >>>><mailto:[EMAIL PROTECTED]> >>>> >>>> >>> >>>-- >>>To unsubscribe, e-mail: >>> >><mailto:[EMAIL PROTECTED]> >> >>>For additional commands, e-mail: >>> >><mailto:[EMAIL PROTECTED]> >> >>> >>Hi Martin, >> >>If I create a request wrapper, I can add whatever state and >>accessor or >>other methods which may be useful to some other process that >>knows that >>they are there. What I am really asking is this: >> >>Because I am using struts, I have a ActionServlet and a request >>processor which based on the request's stored URI, locates a mapping >>which is defined in struts-config.xml and this mapping directs to a >>handler (my action class). I want to be able to change the >>URI (the one >>which the framework uses to locate the mapping) so that a different >>mapping will be selected. >> >>So I'm not talking about adding specific behaviour or state to the >>request - I want to access the existing state and modify it >>and have the >>framework go about it's usual business of doing the delegating to my >>action etc (based on the updated state). >> >>It is possible to override the ActionServlet and/or the request >>processor in struts which may or may not be neccessary - depending on >>what can be achieved from a filter. >> >>So I want to know where I could alter the request URI with >>this change >>being visible to what ever processes the request to select the struts >>mapping. >> >> >>cheers >>jfc >> >> >> >> >>-- >>To unsubscribe, e-mail: >><mailto:[EMAIL PROTECTED]> >>For additional commands, e-mail: >><mailto:[EMAIL PROTECTED]> >> >> > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>