SUre
In struts we have concept of savetokens()
SaveToken is a method which you have to set to false/ture before the form
get loaded and get submitted

Follwoing is the snapshot for the same.




 public ActionForward execute(ActionMapping mapping,
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws
Exception {
        // Extract attributes and/or parameters we will need

     // When "navigating" to this action, ActionForm is null, so
        // user's info is copied into the form and then saved in request
scope
        if (form == null) {
            // Set a transactional control token to prevent double posting
            saveToken(request);
   }

//IF this Action has been called of by Submit Form
 // Validate the transactional control token
        if (!isTokenValid(request))//This is an inbuild method of ACtion
class to check the Token
{

            request.setAttribute(DOUBLE_POST_ATTEMPT_KEY, "trapped");
            return new ActionForward(mapping.getInput());
        }



HOpe this may help

Cheers
Gary

----- Original Message -----
From: "Viral_Thakkar" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, December 09, 2003 6:42 PM
Subject: RE: Refresh -submit relation


> Could you please provide some more details about this?
>
> -----Original Message-----
> From: Gurpreet Dhanoa [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 09, 2003 5:54 PM
> To: Struts Users Mailing List
> Subject: Re: Refresh -submit relation
>
>
> Hi
>
> You need to use the concept of saveTokens Which prevent yoyr form from
> getting submitted twice
>
> Cheers
> gary
>
> ----- Original Message -----
> From: "Viral_Thakkar" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, December 09, 2003 5:17 PM
> Subject: Refresh -submit relation
>
>
> > I have a page for upload functionality which uploads the files to a
> > folder.
> >
> > Here I am referring the struts example for uploading of files and I am
> > inserting the record in table at the same time.
> >
> > This upload is working fine but problem is when I refresh the browser
> > page, the page is getting submitted again. Due to this duplicate
> records
> > are inserted in the database.
> >
> > Is there any way, to stop the page to submit on refresh?
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to