I can think of a couple of ways. One of them you already have identified,
namely change the button name on JSP 2. The other option that I thought of
is to set the "redirect" attribute to "true" on the forward element in
ACTION1's action mapping. This will cause the browser to send a new request
to ACTION2 and FORM2 will not be populated with your button name. Of course
if you had planned on capturing any data from the original request (except
the button name), then this approach would not work.

----- Original Message -----
From: "Jagdish Arora" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 7:13 PM
Subject: same button on two consecutive forms confuses the second action


>
> Problem: I have same button on two consecutive JSPs (say JSP1 and JSP2).
> When the button (btnName1) is clicked on JSP1, first that button is copied
> on FORM1, and then on FORM2.  Is there any standard way to get rid of this
> problem?
>
> My understanding of the sequence of steps is:
>   1.. JSP1 submitted, the Servlet Request SR (SR has btnName1="value1")
>   2.. AS sets the request parameters of SR on FORM1
>   3.. AS calls ACTION1.execute(), which returns ACTION2
>   4.. AS sets the request parameters of request (still SR) on FORM2
>   5.. AS calls ACTION2.execute(), which gets messed up, because of wrong
> data on FORM2
> Please let me know if there is any smarter way than manually changing the
> names of parameters (and Form properties).
>
> best,
> Amrinder
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 12/30/2002

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

Reply via email to