HI

Alok , here is the code for it

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: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 10, 2003 12:54 PM
Subject: Re: Error message display in the case of redirect = true


>
> Hello Gurpreet,
> Thanks for the input but can you please send me an example of how to do
it.
>
> Alok Garg
> Polaris Software Lab Ltd.
> ( + 91 - 022 - 28290019 Ext. # 1308 )
>
>
>
>                       "Gurpreet Dhanoa"
>                       <[EMAIL PROTECTED]         To:      "Struts Users
Mailing List" <[EMAIL PROTECTED]>
>                       atainc.com>               cc:      (bcc:
alok.garg/Polaris)
>                                                 Subject: Re: Error message
display in the case of redirect = true
>                       12/10/03 11:28 AM
>                       Please respond to
>                       "Struts Users
>                       Mailing List"
>
>
>
>
>
>
> hi ALok
>
> You can stop the resubmitting of form with the help of Tokens in struts
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, December 10, 2003 11:00 AM
> Subject: RE: Error message display in the case of redirect = true
>
>
> >
> >
> > You are right even I knew that it was the same problem. But then in that
> > case if I make redirect = false and if the user refreshes the page then
> the
> > request is again submitted.
> > So, can you throw some light on how to stop the user from re submitting
> the
> > same URL.
> >
> > Alok Garg
> > Polaris Software Lab Ltd.
> > ( + 91 - 022 - 28290019 Ext. # 1308 )
> >
> >
> >
> >                       "Navjot Singh"
> >                       <[EMAIL PROTECTED]         To:      "Struts Users
> Mailing List" <[EMAIL PROTECTED]>
> >                       dia.net>                 cc:      (bcc:
> alok.garg/Polaris)
> >                                                Subject: RE: Error
message
> display in the case of redirect = true
> >                       12/09/03 06:02
> >                       PM
> >                       Please respond
> >                       to "Struts Users
> >                       Mailing List"
>
> >
> >
> >
> >
> >
> >
> > not sure but the logic says that error messages are being stored in the
> > REQUEST SCOPE and when you set redirect=true, naturally that's a new
> > request
> > so you won't get the errors set in earlier request.
> >
> > anybody else?
> >
> > >-----Original Message-----
> > >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > >Sent: Tuesday, December 09, 2003 5:53 PM
> > >To: Struts Users Mailing List
> > >Subject: Error message display in the case of redirect = true
> > >
> > >
> > >Hello all,
> > >I want to display the errors stack provided y Struts in the jsp page
> using
> > >the <html:errors/> tag. I am able to display it but the moment I add
the
> > >redirect=true in the action mapping tag I am not able to see the error
> > >messages.
> > >
> > >Please help with it.
> > >
> > >Alok Garg
> > >Polaris Software Lab Ltd.
> > >( + 91 - 022 - 28290019 Ext. # 1308 )
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > 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]


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

Reply via email to