struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hubert Rabago <>
Subject Re: forward vs redirect ?
Date Mon, 01 Dec 2003 16:51:56 GMT
Hi Caroline,

I sent you a struts war file ready to deploy.  It includes all source files. 
Call up the, enter a bid amount, submit the form, then refresh on
the resulting page.  Both action objects do a System.out.println when they're
called.  When you refresh the page after submitting the bid, you'll see that is the only one being called, and that the address bar will show
the URL.
I ran this in Tomcat 4.1.x.
Please reply to this mailing list so others can help if there are issues.

Here's the mappings:
        <action path="/displayItem"
            <forward name="doDisplay" path="/item.jsp"/>
        <action path="/processBid"
            <forward name="doRedirect" path="/" redirect="true"/>


--- Caroline Lauferon <> wrote:
> > For example, say i had an action which saved some details from a form to a
> > database. if the page is not redirected then if the user were to refresh
> the
> > page, the action would be called again and the data saved again. This
> > obviously i would not want the user to do so in this case i redirect the
> > page, so that if the user were to refresh the page, the save action would
> > not be called again.
> I'm not sure I understand what you mean. The case you describe is very close
> to mine, and so I would like to prevent the user from making twice the
> addition on refresh:
> I've got one first form, Form1, which calls Action1:
> <action path="/action1" name="Form1" type="actions.Action1" scope="session"
> input="/form1.jsp">
>     <forward name="ok" path="page2.jsp" redirect="true"/>
> </action>
> but once the user is on page2, if he makes a refresh, action1 is called
> again.... and the data added by action1 is added once more....
> What didn't I understand?
> Thanks
> Caroline
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!?
Free Pop-Up Blocker - Get it now

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

View raw message