Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use Cancel button in DispatchAction

 
unnii
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What doesn't work?
 
unnii
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You also said you did a bunch of stuff to avoid the error--are you saying you still get the same error?
 
unnii
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Newton.. am running with those errors..

can you please get me out of it
 
unnii
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic