Hi,
Hmm,, well if you have seen the execute function of the action class it
returns ActionForward value. 

So in ur action class where you have been able to do a sucessfully
commit to the db or performed some action then you need to return the
forward value.

For example

public ActionForward execute(ActionMapping mapping,
                             ActionForm form,
                             javax.servlet.http.HttpServletRequest
request,
                             javax.servlet.http.HttpServletResponse
response)
                      throws java.lang.Exception
{


        String target = new String();
        If (result) {
                target = "success";
        } else {
                target = "failure";
        }

        return (mapping.findForward(target));
}


In ur structs-config.xml make the rquire <forward tags for the target
values "success" and "failure"

Hope this helps!!


-----Original Message-----
From: Dinh Nguyen [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 25, 2003 12:11 PM
To: [EMAIL PROTECTED]
Subject: Re: How to do Confirmation page.


Hi Rajat,

Ok, let say, whatever page, the user wants to save the information, 
then the Save (Submit) button will be implemented. But how do you do 
that?  Can you give me example?  how do I use the forward in my 
action class?  

Thanks,
Dinh nguyen

--- In [EMAIL PROTECTED], "Rajat Pandit" <[EMAIL PROTECTED]> wrote:
> <html:cancel.. Should do the job. However you could use do different 
> forwards in ur action class. Depending on the value of submit
clicked
> on.
> Also to keep it simple, just javascript on the onClick even on the 
> cancel button and use the actual submit button for sending the
content
> to the action class via the controller.
> 
> 
> -----Original Message-----
> From: Dinh Nguyen [mailto:[EMAIL PROTECTED]
> Sent: Saturday, October 25, 2003 12:02 PM
> To: [EMAIL PROTECTED]
> Subject: How to do Confirmation page.
> 
> 
> Hi,
> 
> Do you know how to do the confirm page using struts?  For example,
> after a person fill-out a registration form, he/she clicks on 
Submit 
> button, she/he will be redirected to a page says that "are you sure
> you want to submit information?".  If the use clicks yes, button, 
> then he/she will be redirected back to the home page, otherwise, 
> he/she will be redirected back to registration form/page if the 
> cancel button is clicked.
> 
> Thanks,
> dinh Nguyen
> 
> 
> --------------------------------------------------------------------
-
> 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