I do what Andrew does too. I don't see it as being too laborious, considering that I feel the ActionForward's original URL should be good enough as it is in most cases not to need appending to.

Otherwise I think I would look at redesigning my approach in a more Struts-like manner.

On 02/09/2004 11:12 AM Manjunath Bhat wrote:
Hi,
You may look into this URL,
http://issues.apache.org/bugzilla/show_bug.cgi?id=866 , which addresses
similar(same) issue.

Also follow the thread "redirect=true & ActionErrors" in this list.

Manjunath




-----Original Message-----
From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 2:54 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: Need to modify the URL path of the forward dynamically


Andrew's procedure is what my team has done on one project, too.
Originally,
we tried getting the ActionForward and changing it directly, but it
turns
out that is a shared instance and changing the original was messing up
other
requests. After we discovered this problem, we switched to Andrew's
scheme
of creating a new ActionForward to return from the Action.

I posted a message today with a note about dynamically adding a query
string
to an ActionForward in the "URL does not change even after changing
action"
thread. This thread has the details about how to do that.

I am interested to hear from other folks if they have a novel way to do
this
(i.e. add a query string to an ActionForward). Anybody got a better way?

-Max

----- Original Message ----- From: "Andrew Hill" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 12:36 AM
Subject: RE: Need to modify the URL path of the forward dynamically




Need to modify the URL path of the forward dynamicallyGet the Forward
instance as usual. Obtain its url string using getPath(). Add your
additional parameter to end of string and create a new ActionForward
instance that uses the decorated path (and copies the redirect

property from

the original action forward), and return this new actionforward

instance.


 -----Original Message-----
 From: Swaminathan Rajagopalan [mailto:[EMAIL PROTECTED]
 Sent: Monday, 9 February 2004 16:34
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Cc: Kamal_Poddar
 Subject: Need to modify the URL path of the forward dynamically


Hi,


We have a URL in the path attribute of a forward for an action. We

need to

dynamically append some request variables to this URL in the action

class,


for they are available only at execution time. How can this be

achieved?


 E.g
  <action    path="/additionalAccountInfoScreen"



type="xxx.yyy.zzz.web.control.action.AdditionalAccountInfoScreenAction"


                name="additionalAccountInfoForm"
                validate="false"
                input="previousPage"
                parameter="populateStmt"
                scope="session">
         <forward name="url"

path="http://www.xyz.com/checks/";


 To the URL path here e.g http://www.xyz.com/checks we need to add
accessId=xxx at run time in the action
class(http://www.xyz.com/checks?accessId=xxx).

Please let us know how this can be done?

 Regards,
 Swaminathan Rajagopalan,
 Ph : (8520261) Extn: 55955
 Mail : [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to