You can use an org.apache.struts.action.ActionRedirect

ActionForward forward = mapping.findForward("reload");
ActionRedirect redirect = new ActionRedirect(forward);
redirect.addParameter("id", idValue);
return redirect;


Antonis Lebesis wrote:
Hi,
 I do have a SelectFooAction (actually it's called ChooseFooAction
:)). There is another problem though:
 This action is used in more than one places so I have to add a
parameter called action in it's url (action=display for a simple user,
action=edit for the admin etc). Since I have a lot of foo's, I have a
form in this page to select which category of Foo's to display. When
the user selects  a category, the page is reloaded (through another
"reload" mapping) which leads us from selectFoo.do?action=display to
selectFoo.do.
 Do you see a pattern here ;)?

Antonis

On 6/21/06, Monkeyden <[EMAIL PROTECTED]> wrote:
>The only thing that I
>can think of is to redirect the user to a different (perhaps error)

exactly, send them back to wherever they go to select the foo they want to
look at.  Do you have a SelectFooAction?


On 6/20/06, Antonis Lebesis <[EMAIL PROTECTED]> wrote:
>
> Thank you Don.
> I have done that and the session expiry problem is solved. The
> bookmark problem still exists though...
> There is a way to overcome this as well:
>
>   ActionForward forward = new ActionForward();
>   forward.setPath(mapping.findForward("reload").getPath() + "&id=23");
>
> which redirects to http://my.foo.site/loadFoo.do&id=23 , but this is
> a hack I wouldn't like to use (plus I would have to change the code
> for ~60 classes many of which are DispatchActions: a lot of work
> :))...
>
> Antonis
>
>
> On 6/20/06, Don Vawter <[EMAIL PROTECTED]> wrote:
> > Can you take the request parameter and populate a hidden form field
> > with it? Mixing request params with form fields
> > has caused me grief more than once.
> >
> > On Jun 19, 2006, at 7:34 PM, Antonis Lebesis wrote:
> >
> > > Hello,
> > >  I have a jsp (foo.jsp) that displays information about a certain
> > > foo. I have defined a LoadFooAction, that prepares the foo object and
> > > the SubmitFooAction, that is called when I want to change the
> > > appearance of foo in foo.jsp [suppose that foo is a list of bars and
> > > that I want to change the order of bars (by name, by date etc)].
> > >
> > >  In struts-config.xml I have defined the following:
> > >  <action path="/loadFoo" type="LoadFooAction" name="FooForm">
> > >    <forward name="success" path="/foo.jsp"/>
> > >  </action>
> > >  <action path="/submitFoo" type="SubmitFoo" name="FooForm">
> > >    <forward name="reload" path="/loadFoo.do" redirect="true"/>
> > >  </action>
> > >
> > > In order to identify which foo to load, I have added a parameter in
> > > loadFoo, called id, ie
> > >    http://my.foo.site/loadFoo.do&id=23
> > >
> > >  The problem is that when I press submit in foo.jsp, the execute
> > > method in SubmitFooAction redirects the browser to
> > > http://my.foo.site/loadFoo.do, loosing the id parameter from the url. > > > I can store either foo or "id=23" to session and retrieve them from > > > there when the id parameter is not present, but what happens when the > > > session expires and the user presses refresh or if the user decides to > > > bookmark the page? I end up with a loadFoo.do without any information
> > > about which foo to display.
> > >
> > > Has any of you dealt with this problem before? The only thing that I > > > can think of is to redirect the user to a different (perhaps error) > > > page when no info is available, but I would really like to be able to
> > > do something better than that.
> > >
> > > Thanks in advance,
> > > Antonis
> > >
> > > PS. I know it's long, but it's 4:30 in the morning (EEST)...
> > >
> > > ---------------------------------------------------------------------
> > > 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]
> >
> >
>
> ---------------------------------------------------------------------
> 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]



--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com

Reply via email to