You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcus Biel <Ma...@bmw.de> on 2002/11/05 15:24:54 UTC

Don't want the ActionForm to refill my form.

I want to add data records using a jsp.
When the user entered the data, and hits submit, an actions adds the
data record to the database.
When this is done, it forwards to the same page again, so that the user
can add more data records.

The problem is that the form gets filled by the ActionForm again, when
forwarding.
That's a bit confusing for a user who simply wants to add new data, but
he gets shown the old data he just entered.

Any ideas how to prevent the Actionform from refilling the form on the
jsp ?


thx,

marcus

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Don't want the ActionForm to refill my form.

Posted by Robert Taylor <rt...@mulework.com>.
Redirect instead of forward. You can do this in your struts-config.xml file
for your action by setting the redirect attribute of the forward element to
true; or, if you are manually creating the forward, the constructor takes a
boolean which indicates a redirect instead of a forward.

robert

> -----Original Message-----
> From: Marcus Biel [mailto:Marcus.Biel@bmw.de]
> Sent: Tuesday, November 05, 2002 9:25 AM
> To: struts-user@jakarta.apache.org
> Subject: Don't want the ActionForm to refill my form.
>
>
> I want to add data records using a jsp.
> When the user entered the data, and hits submit, an actions adds the
> data record to the database.
> When this is done, it forwards to the same page again, so that the user
> can add more data records.
>
> The problem is that the form gets filled by the ActionForm again, when
> forwarding.
> That's a bit confusing for a user who simply wants to add new data, but
> he gets shown the old data he just entered.
>
> Any ideas how to prevent the Actionform from refilling the form on the
> jsp ?
>
>
> thx,
>
> marcus
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>