RE: Add paramaters to a forward dynamically

2003-01-12 Thread Robert Taylor
Sorry it didn't work for you and sorry I didn't include all the details such
as the algorithm used in
the example. The idea is the same though.

- Get the path from the existing ActionForward
- Manually append query string parameters to the path
- Create a new ActionForward with the modified path
- Return the new ActionForward

My example was simple so as to illustrate the basic goal.

I'm glad you found something that works.

robert

> -Original Message-
> From: John Menke [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 11, 2003 5:46 PM
> To: Struts Users Mailing List
> Subject: RE: Add paramaters to a forward dynamically
>
>
> Robert,
>
> thanks for your suggestion.  I could not get it to work properly.
> Something
> with urls not being processed correctly, I'm using tiles...(not
> sure if that
> is explanation though)
>
> What I did get to work was what is suggested in this:
>
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14224.html
>
>
> -jm
>
>
>
>
>
>
>
>
> > -Original Message-
> > From: Robert Taylor [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, January 11, 2003 3:28 PM
> > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > Subject: RE: Add paramaters to a forward dynamically
> >
> >
> > int id = // get user id
> > String path = forward.getPath();
> > path = path + "?ID=" + id;
> > return new ActionForward(path);
> >
> > hth,
> >
> > robert
> >
> > > -Original Message-
> > > From: John Menke [mailto:[EMAIL PROTECTED]]
> > > Sent: Saturday, January 11, 2003 2:57 PM
> > > To: struts-user
> > > Subject: Add paramaters to a forward dynamically
> > >
> > >
> > > I have a global forward:
> > >
> > > 
> > >
> > > I really want the user to forward to "do/myModule?ID=115"
> > >
> > > the actual value of ID in this case would be determined in the
> > > Action class
> > > that calls the findForward("DynamicForward") method.
> > >
> > > is there any way of returning a forward with parameters from
> an Action?
> > >
> > > -jm
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > 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]>


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




RE: Add paramaters to a forward dynamically

2003-01-11 Thread John Menke
Jacob,

Not sure about the issue you describe but this definitely works for me.  it
forwards to my
global forward and appends a parameter to the request

so if I have the forward configured as



I can use the class in the attached link to change the forward  into
/do/Module?ID=111 or something like that in my action

-jm

> -Original Message-
> From: Jacob Hookom [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 11, 2003 7:47 PM
> To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
> Subject: RE: Add paramaters to a forward dynamically
>
>
> I'm surprised that works, I usually add everything to the request as an
> Attribute, and since I'm usually using JSTL for page renders, it's all
> the same as far is the page is concerned for variables.  Forwarding
> occurs as normal then without parameter declaration.
>
> I thought there was an issue with include/redirect with actually being
> able to read parameters in after the first Action?
>
> -Jacob
>
> | -Original Message-
> | From: John Menke [mailto:[EMAIL PROTECTED]]
> | Sent: Saturday, January 11, 2003 4:46 PM
> | To: Struts Users Mailing List
> | Subject: RE: Add paramaters to a forward dynamically
> |
> | Robert,
> |
> | thanks for your suggestion.  I could not get it to work properly.
> | Something
> | with urls not being processed correctly, I'm using tiles...(not sure
> if
> | that
> | is explanation though)
> |
> | What I did get to work was what is suggested in this:
> |
> |
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14224.html
> |
> |
> | -jm
> |
> |
> |
> |
> |
> |
> |
> |
> | > -Original Message-----
> | > From: Robert Taylor [mailto:[EMAIL PROTECTED]]
> | > Sent: Saturday, January 11, 2003 3:28 PM
> | > To: Struts Users Mailing List; [EMAIL PROTECTED]
> | > Subject: RE: Add paramaters to a forward dynamically
> | >
> | >
> | > int id = // get user id
> | > String path = forward.getPath();
> | > path = path + "?ID=" + id;
> | > return new ActionForward(path);
> | >
> | > hth,
> | >
> | > robert
> | >
> | > > -Original Message-
> | > > From: John Menke [mailto:[EMAIL PROTECTED]]
> | > > Sent: Saturday, January 11, 2003 2:57 PM
> | > > To: struts-user
> | > > Subject: Add paramaters to a forward dynamically
> | > >
> | > >
> | > > I have a global forward:
> | > >
> | > >  redirect="true"/>
> | > >
> | > > I really want the user to forward to "do/myModule?ID=115"
> | > >
> | > > the actual value of ID in this case would be determined in the
> | > > Action class
> | > > that calls the findForward("DynamicForward") method.
> | > >
> | > > is there any way of returning a forward with parameters from an
> | Action?
> | > >
> | > > -jm
> | > >
> | > >
> | > >
> | > >
> | > >
> | > >
> | > > --
> | > > 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:struts-user-
> | [EMAIL PROTECTED]>
> | For additional commands, e-mail: <mailto:struts-user-
> | [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]>




RE: Add paramaters to a forward dynamically

2003-01-11 Thread Jacob Hookom
I'm surprised that works, I usually add everything to the request as an
Attribute, and since I'm usually using JSTL for page renders, it's all
the same as far is the page is concerned for variables.  Forwarding
occurs as normal then without parameter declaration.

I thought there was an issue with include/redirect with actually being
able to read parameters in after the first Action?

-Jacob

| -Original Message-
| From: John Menke [mailto:[EMAIL PROTECTED]]
| Sent: Saturday, January 11, 2003 4:46 PM
| To: Struts Users Mailing List
| Subject: RE: Add paramaters to a forward dynamically
| 
| Robert,
| 
| thanks for your suggestion.  I could not get it to work properly.
| Something
| with urls not being processed correctly, I'm using tiles...(not sure
if
| that
| is explanation though)
| 
| What I did get to work was what is suggested in this:
| 
|
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14224.html
| 
| 
| -jm
| 
| 
| 
| 
| 
| 
| 
| 
| > -Original Message-
| > From: Robert Taylor [mailto:[EMAIL PROTECTED]]
| > Sent: Saturday, January 11, 2003 3:28 PM
| > To: Struts Users Mailing List; [EMAIL PROTECTED]
| > Subject: RE: Add paramaters to a forward dynamically
| >
| >
| > int id = // get user id
| > String path = forward.getPath();
| > path = path + "?ID=" + id;
| > return new ActionForward(path);
| >
| > hth,
| >
| > robert
| >
| > > -Original Message-
| > > From: John Menke [mailto:[EMAIL PROTECTED]]
| > > Sent: Saturday, January 11, 2003 2:57 PM
| > > To: struts-user
| > > Subject: Add paramaters to a forward dynamically
| > >
| > >
| > > I have a global forward:
| > >
| > > 
| > >
| > > I really want the user to forward to "do/myModule?ID=115"
| > >
| > > the actual value of ID in this case would be determined in the
| > > Action class
| > > that calls the findForward("DynamicForward") method.
| > >
| > > is there any way of returning a forward with parameters from an
| Action?
| > >
| > > -jm
| > >
| > >
| > >
| > >
| > >
| > >
| > > --
| > > 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:struts-user-
| [EMAIL PROTECTED]>
| For additional commands, e-mail: <mailto:struts-user-
| [EMAIL PROTECTED]>


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




RE: Add paramaters to a forward dynamically

2003-01-11 Thread John Menke
Robert,

thanks for your suggestion.  I could not get it to work properly. Something
with urls not being processed correctly, I'm using tiles...(not sure if that
is explanation though)

What I did get to work was what is suggested in this:

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14224.html


-jm








> -Original Message-
> From: Robert Taylor [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 11, 2003 3:28 PM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: Add paramaters to a forward dynamically
>
>
> int id = // get user id
> String path = forward.getPath();
> path = path + "?ID=" + id;
> return new ActionForward(path);
>
> hth,
>
> robert
>
> > -Original Message-
> > From: John Menke [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, January 11, 2003 2:57 PM
> > To: struts-user
> > Subject: Add paramaters to a forward dynamically
> >
> >
> > I have a global forward:
> >
> > 
> >
> > I really want the user to forward to "do/myModule?ID=115"
> >
> > the actual value of ID in this case would be determined in the
> > Action class
> > that calls the findForward("DynamicForward") method.
> >
> > is there any way of returning a forward with parameters from an Action?
> >
> > -jm
> >
> >
> >
> >
> >
> >
> > --
> > 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]>




RE: Add paramaters to a forward dynamically

2003-01-11 Thread Robert Taylor
int id = // get user id
String path = forward.getPath();
path = path + "?ID=" + id;
return new ActionForward(path);

hth,

robert

> -Original Message-
> From: John Menke [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 11, 2003 2:57 PM
> To: struts-user
> Subject: Add paramaters to a forward dynamically
> 
> 
> I have a global forward:
> 
> 
> 
> I really want the user to forward to "do/myModule?ID=115"
> 
> the actual value of ID in this case would be determined in the 
> Action class
> that calls the findForward("DynamicForward") method.
> 
> is there any way of returning a forward with parameters from an Action?
> 
> -jm
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: