• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use Cancel button in DispatchAction

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What doesn't work?
 
unnii
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic