You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "S. K . Srinivasan" <sr...@yahoo.com> on 2003/07/28 22:29:51 UTC
browser refresh - calls more than one action
Hi,
In struts I have action_class1 ( AC1 ) , action_class 2 (AC2)
>From AC1 , when user clicks button , i insert a record and then i call AC2. ( I use findForward to call AC2 from AC1 )
In the JSP ( VIEW ) of AC2 , when user presses refresh , the struts controller instead of calling just AC2 , it calls AC1 and then AC2 , leading to duplicate record.
When we do forward , Is there any way to make controller to call only AC2 when the refresh on JSP of AC2 is pressed.
I can not use Following ways
REDIRECT : I can not use Redirect as i am setting some param . Also i can not do a URL appending , since In Browser URL should not show form data as per our policy.
Synchornizing Tokens: There are lot of Action & JSP. Very Tough to implement.
Any suggestions.
regards,
srini sk
SMS using the Yahoo! Messenger;Download latest version.
Re: browser refresh - calls more than one action
Posted by Jing Zhou <ji...@netspread.com>.
Have you tried to use the HTML4 base tag?
The spec states that a document lacking a base element should
by default use the current document's URL as the base URL.
Of course, the current URL is something like /AC1.do in your
case. I guess in the JSP for AC2, you could put a base element
between the head with the attribute href="/AC2.do" (or something
like that)
It could introduce side effects in your JSP pages when using
the base element.
Jing
Netspread Carrier
http://www.netspread.com
----- Original Message -----
From: "S. K . Srinivasan" <sr...@yahoo.com>
To: <st...@jakarta.apache.org>
Sent: Monday, July 28, 2003 3:29 PM
Subject: browser refresh - calls more than one action
>
>
> Hi,
>
> In struts I have action_class1 ( AC1 ) , action_class 2 (AC2)
>
> From AC1 , when user clicks button , i insert a record and then i call
AC2. ( I use findForward to call AC2 from AC1 )
>
> In the JSP ( VIEW ) of AC2 , when user presses refresh , the struts
controller instead of calling just AC2 , it calls AC1 and then AC2 , leading
to duplicate record.
>
> When we do forward , Is there any way to make controller to call only AC2
when the refresh on JSP of AC2 is pressed.
>
> I can not use Following ways
>
> REDIRECT : I can not use Redirect as i am setting some param . Also i can
not do a URL appending , since In Browser URL should not show form data as
per our policy.
>
> Synchornizing Tokens: There are lot of Action & JSP. Very Tough to
implement.
>
> Any suggestions.
>
> regards,
>
> srini sk
>
> SMS using the Yahoo! Messenger;Download latest version.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: browser refresh - calls more than one action
Posted by "Bradley M. Handy" <bh...@arbor.edu>.
Your "redirect" attribute of your forwards is set to "false" (which is
the default value). Try changing it to "true" for your AC1->AC2 forward
and see if that helps.
Brad
-------------------------------------------------
Bradley M. Handy | Office: 517 750 6675
Programmer/Analyst | Email: bhandy@arbor.edu
Spring Arbor University |
-------------------------------------------------
Sun Certified Programmer for the Java 2 Platform
-------------------------------------------------
> -----Original Message-----
> From: S. K . Srinivasan [mailto:srinivas_an@yahoo.com]
> Sent: Monday, July 28, 2003 4:30 PM
> To: struts-user@jakarta.apache.org
> Subject: browser refresh - calls more than one action
>
>
>
> Hi,
>
> In struts I have action_class1 ( AC1 ) , action_class 2 (AC2)
>
> >From AC1 , when user clicks button , i insert a record and then i
call
> AC2. ( I use findForward to call AC2 from AC1 )
>
> In the JSP ( VIEW ) of AC2 , when user presses refresh , the struts
> controller instead of calling just AC2 , it calls AC1 and then AC2 ,
> leading to duplicate record.
>
> When we do forward , Is there any way to make controller to call only
AC2
> when the refresh on JSP of AC2 is pressed.
>
> I can not use Following ways
>
> REDIRECT : I can not use Redirect as i am setting some param . Also i
can
> not do a URL appending , since In Browser URL should not show form
data as
> per our policy.
>
> Synchornizing Tokens: There are lot of Action & JSP. Very Tough to
> implement.
>
> Any suggestions.
>
> regards,
>
> srini sk
>
> SMS using the Yahoo! Messenger;Download latest version.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org