struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Twan Kogels <t...@twansoft.com>
Subject RE: ActionForward with runtime parameter?
Date Thu, 08 Jul 2004 14:21:22 GMT
Hello,

Thanks for the replies! Yes, the parameter should be passed as a real 
parameter. I tryed the setattribute/getattribute method but that resulted 
in strange side effects. To remove the side effects more code lines we're 
needed. I guess i'll stick to my new ActionForward method.

Cheers,
Twan

At 14:32 08-7-2004, you wrote:
>yeh. If you set it as an attribute and try to get it as a parameter your in
>for some dissapointment ;-)
>Doing it as an attribute would be ok though so long as its a non-redirecting
>forward and the place you forward to knows to expect it as an attribute.
>This does however mean you will also be passing along the baggage of all the
>submitted request parameters for this page...
>
>In this case I think that its definately parameters that Twan is after, so
>the new ActionForward technique is the way to go.
>
>-----Original Message-----
>From: Geeta Ramani [mailto:gramani@terralink.com]
>Sent: Thursday, 8 July 2004 20:21
>To: Struts Users Mailing List
>Subject: RE: ActionForward with runtime parameter?
>
>
>Just a couple of small notes here though, (added for the Struts beginner):
>you will be setting and getting a "attribute" not a "parameter". Also you
>will need to set/get it as an Integer not an int..
>
>Geeta
>
> > -----Original Message-----
> > From: Kailash Vasani [mailto:KailashV@quinnox.com]
> > Sent: Thursday, July 08, 2004 8:29 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: ActionForward with runtime parameter?
> >
> >
> > Hi,
> >
> > Set id and it's value in request object and just forward to
> > mapping.findForward("success").
> > In ur target page (where u r forwarding), get the value for
> > parameter (id)
> > from request object.
> >
> > that should do the trick
> >
> > Kailash
> >
> >
> > -----Original Message-----
> > From: Twan Kogels [mailto:twan@twansoft.com]
> > Sent: Thursday, July 08, 2004 5:50 PM
> > To: user@struts.apache.org
> > Subject: ActionForward with runtime parameter?
> >
> >
> > Hello people,
> >
> > I've started my first project with struts. It's working fine,
> > clean and
> > quick. But i have a question regarding actionforwards and
> > parameters to the
> > path.
> >
> > I have a form; when the user submits the form i forward the
> > user to another
> > page. This page requires one parameter (?id=x) to function.
> > Now i use a
> > code like:
> >
> > return new
> > ActionForward(mapping.findForward("success").getPath()+"?id="+
> > glform.getGroe
> > p());
> >
> > to forward and add a parameter. The forward "success"
> > contains the url to
> > the page without parameters (/page.do). I then append the
> > "id=" parameter
> > and create a new ActionForward.
> >
> > The value of the id= parameter is only known when the user
> > submits the
> > form. So i cannot put the id parameter in the struts-config.xml file.
> >
> > Is the above code the best and cleanest way to do the thing i
> > want to do?
> >
> > Cheers,
> > Twan Kogels
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org



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


Mime
View raw message