aspose file tools*
The moose likes Struts and the fly likes How to use Cancel button in DispatchAction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to use Cancel button in DispatchAction" Watch "How to use Cancel button in DispatchAction" New topic
Author

How to use Cancel button in DispatchAction

unnii
Greenhorn

Joined: Jan 21, 2008
Posts: 23
Hi All,

Greetings!!!

My requirement is,using Dispatch Action in Struts1.3, on clicking Cancel button it
takes to another page, say home page..

as for now i tried:

I have Upload and Cancel methods in my jsp .. i extends Dispatch action in my action class

In struts-config.xml, I put parameter called service..

everything worked except Cancel button.. Following are cancel related lines:

in jsp,



in struts-config.xml,



When jsp has <html:cancel /> i get following error:


when jsp <html:cancel property="service" /> i get following error:



for the above error i put a method in action class like the following :

public ActionForward Cancel(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response){

return mapping.findForward("Cancel");
}
and changed <html:cancel property="service" value="Cancel" />
and added <forward name="Cancel" path="/home.jsp" />

still i didnt get the answer...


I hope you got my points clearly.. Any help would be appreciable

Cheers!!!
Unnii
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What doesn't work?
unnii
Greenhorn

Joined: Jan 21, 2008
Posts: 23
Hi Newton,

i am getting errors , which are listed in previous thread, when i click cancel button

i need to forward another page when i click Cancel button

Cheers!!!
Unnii
Rupali Bankar
Greenhorn

Joined: Mar 04, 2009
Posts: 3
as you are using 2 buttons on single form

# <html:submit property="service" value="Upload" />
# <html:cancel />

its better to write LookuoDispatchAction which extends dispatchaction
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You also said you did a bunch of stuff to avoid the error--are you saying you still get the same error?
unnii
Greenhorn

Joined: Jan 21, 2008
Posts: 23
Yes Newton.. am running with those errors..

can you please get me out of it
unnii
Greenhorn

Joined: Jan 21, 2008
Posts: 23
HI Guys,

Can you please help me get rid of this issue... I need to know how to use <html:cancel> tag in Dispatch Action

Cheers!!!
Unnii
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use Cancel button in DispatchAction