You may want to try adding this to the header of your jsp:

<meta http-equiv="expires" content="1" />
<meta http-equiv="pragma" content="no-cache" />

When the reload button is clicked, the browser should ask the user whether
he/she wants to resend the entered information. It does not solve you
problem completely (if the user chooses to resend the information, it is
processed by the action again. But, on the other hand, you should take care
of this e.g. in you validate method - maybe checking for existing name, id,
etc.), but at least alerts the user, that he/she is doing someting
repeatedly.

Radek

> -----Original Message-----
> From: Lijuan Jing [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 22, 2004 9:53 AM
> To: [EMAIL PROTECTED]
> Subject: question related to action and tile
> 
> 
> This is a question related to action and tile.
> 
> <action path="someURL"
>         name="submitForm"
>         type="someActionClass">
>  <forward 
>   name="success"
>   path=".pages.tileDef1"/>
> </action>
> -------------------------------
> tile definition:
>   <definition
>     name=".pages.Base" 
>     path="/pages/common/layouts/baseLayout.jsp">
>     <put name="footer" 
>          value="/pages/common/header.jsp" />
>     <put name="content" 
>          value="/pages/content/home_content.jsp" />
>     <put name="footer" 
>          value="/pages/common/footer.jsp" />
>   </definition>
> 
>   <definition
>     name=".pages.tileDef1" extends=".pages.Base">
>     <put name="content"             
>          value="/pages/content/real_content.jsp" />
>   </definition>
> 
> After someActionClass executed successfully, it
> displays page .pages.tileDef1, but the URL on 
> browser still shows someURL. If user clicks 
> browser's refresh button, the 'submitForm' will
> be submitted again and 'someActionClass' will be
> executed again which end up processing the
> 'submitForm' multiple times depends
> on how many time user clicks refresh. It becomes worse
> if the content of the form will be written to
> database.
> 
> How do I know (while I am in action code) if it comes
> from the real button click or the refresh button
> click? 
> 
> Or I could show a different URL after the form is
> processed, then a dummy action has to be added. Not a
> clean way to do. 
> 
> <action path="someURL"
>         name="submitForm"
>         type="someActionClass">
>  <forward 
>   name="success"
>   path="/do/dummy"/>
> </action>
> 
> <action path="/dummy"
>         name="dummyForm"
>         type="dummyActionClass">
>  <forward 
>   name="success"
>   path=".pages.tileDef1"/>
> </action>
> 
> Thanks,
> Lijuan
> 
> 
> 
> 
>               
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Reply via email to