Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 72887 invoked from network); 3 Sep 2002 21:11:16 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 3 Sep 2002 21:11:16 -0000 Received: (qmail 9819 invoked by uid 97); 3 Sep 2002 21:11:34 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 9803 invoked by uid 97); 3 Sep 2002 21:11:33 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 9790 invoked by uid 98); 3 Sep 2002 21:11:32 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <3D753788.4010804@btopenworld.com> Date: Tue, 03 Sep 2002 22:28:24 +0000 From: jfc User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010913 X-Accept-Language: en-us MIME-Version: 1.0 To: Tomcat Users List Subject: Re: altering the request URI in a filter References: <7382FCA44E27D411BD4A00508BD68F9504BB0C18@pigeon.tumbleweed.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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? > >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(). > >If you want to do something inside of Struts, you'll have to make do with >the RequestDispatcher, as someone else suggested. > >-- >Martin Cooper > > >>-----Original Message----- >>From: jfc [mailto:jfc100@btopenworld.com] >>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:jfc100@btopenworld.com] >>>>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: >>>> >>>>For additional commands, e-mail: >>>> >>>> >>>> >>> >>>-- >>>To unsubscribe, e-mail: >>> >> >> >>>For additional commands, e-mail: >>> >> >> >>> >>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: >> >>For additional commands, e-mail: >> >> >> > > >-- >To unsubscribe, e-mail: >For additional commands, e-mail: > > I see now what you were saying. This would work just as well. Thanks. jfc -- To unsubscribe, e-mail: For additional commands, e-mail: