• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

DispatchAction and html:cancel

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On my jsp page I have three buttons and a cancel button.

<html:submit property="direction">
<bean:message key="button1">
</html:submit>
<html:submit property="direction">
<bean:message key="button2">
</html:submit>
<html:submit property="direction">
<bean:message key="button3">
</html:submit>
<html:cancel> Cancel </html:cancel>

When the cancel button is hit on the page I get the following error:
javax.servlet.ServletException:Request [/aForm] does not contain handler parameter named 'direction'. This may be caused by whitespace in the label text.
org.apache.struts.DispatchAction.unspecified(DispatchAction.java:224)
org.apache.struts.DispatchAction.dispatchMethod(DispatchAction.java:258)
org.apache.struts.DispatchAction.LookupDispatchAction.execute(LookupDispatchAction.java:162)
...

When the page came up I did a view source and the submit tags get rendered as:

<input type="submit" name="direction" value="button1">
<input type="submit" name="direction" value="button2">
<input type="submit" name="direction" value="button3">
<input type="submit" name="org.apache.struts.taglib.html.CANCEL" value="Cancel" onklick="bCancel=true">

Do I need to configure my own cancel button or how do I configure DispatchAction to recoginize the cancel button?

Thanks in advance.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
just replace the below with
<html:cancel> Cancel </html:cancel>
with
<input type="submit" name="direction" value="Cancel" onklick="bCancel=true">
this will work fine for you
 
Whitney Albrecht
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To all having a similar problem,

you can use <html:cancel> with the LookupDispatch action ... you just need to override the cancelled function and replace it with what you want to do.

-Whitney
[ September 27, 2005: Message edited by: Whitney Albrecht ]
 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic