struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Caswell" <scasw...@allconnect.com>
Subject RE: Dynamic ActionMapping params
Date Wed, 23 Jul 2003 19:25:19 GMT
The way I've solved this is to:

- get the configured ActionForward from mapping.findFoward("BLA")
- build a new path string using the path from the configured ActionForward and the dynamic
querystring
- create a new instance of ActionForward
- populate it with the new path and the other properties from the configured ActionForward
- return this new ActionForward

May not be elegant, but it works for me.

-----Original Message-----
From: Jim Kennedy [mailto:jimk@gigaheads.com]
Sent: Wednesday, July 23, 2003 3:03 PM
To: struts-user@jakarta.apache.org
Subject: Dynamic ActionMapping params


I have created several sites that use the "mapping.findForward("BLA") method to forward (or
redirect) to a relative URL.  This has always been statically specified in my struts-config.xml
like this:

<forward name="success" path="/main_layout.jsp" redirect="true"/>

then in code I do:

mapping.findForward("BLA");   //(simple stuff)



Now I have a need to forward to a URL that will have dynamic parameters like this:

/main_layout.jsp?param1=value&param2=value$param3=value

Not sure how to pull this off.  Obviously I can't use a statically defined forward definition.
 I guess I could put the params in the request, which works fine if I forward, but what if
I redirect.  I would have to put them in the session.  Not clean coding in my opinion.  I
would rather specify as querystring params.

Anyone done this?

I am using Struts v1.02



Jim Kennedy
IT Consultant
-----------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message