The forward definition should be just /go.do and then before doing forward add the 
param to the actionFOrward...

Something like

return new ActionFOrward(forward.getPath() + "?" + "page=" + "templateEdit")

-----Original Message-----
From: CuteProgrammer [mailto:[EMAIL PROTECTED]
Sent: Monday, October 13, 2003 3:27 PM
To: [EMAIL PROTECTED]
Subject: Dynamic ActionForwarding


Hi All...

 I'm not able to find the solution for this from last one month. Okay here goes my 
problem. Well i  in need to generate(dynamically) the ActionForwards based on data in 
the controller which has been extracted based on some user credentials. 

Eg  :

Lets assume we have a combo box  with some elements.  Based the the selection we need 
to take him to different pages. Lets say user selected some thing which has ID "101". 
Now what i did in cotroller is i extracted the data  from the database based on the 
selected id. then the url i need to forward will be  some thing like this  

                      /go.do?page=templateEdit

where  the value "templateEdit" is extracted from database based on the user selected 
id.

for solving this problem what i did is this. declared an actionforward like this

        <forward name="actionPage" path="/go.do?page={0}"/>

and in controller used the following code

<code>
            MessageFormat msgFormat = new 
MessageFormat(mapping.findForward("actionPage").getPath());        
            String path = msgFormat.format(new String[] {action});
            forward = new ActionForward(path);
</code>


what happens is first time it woks fine.But from the second time its still going to 
the first selected page. Can any one guess what is the problem.. or any other 
alternative way to do this.  one thing is i dont want to user new 
ActionForward("/go.do?page=templateEdit");

Thanks
Abhi

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

Reply via email to