This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Struts and the fly likes DispatchAction and html:cancel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "DispatchAction and html:cancel" Watch "DispatchAction and html:cancel" New topic

DispatchAction and html:cancel

Whitney Albrecht

Joined: May 09, 2005
Posts: 19
On my jsp page I have three buttons and a cancel button.

<html:submit property="direction">
<bean:message key="button1">
<html:submit property="direction">
<bean:message key="button2">
<html:submit property="direction">
<bean:message key="button3">
<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.

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.
srikanth singamsetty

Joined: Sep 27, 2005
Posts: 7
Hi ,
just replace the below with
<html:cancel> Cancel </html:cancel>
<input type="submit" name="direction" value="Cancel" onklick="bCancel=true">
this will work fine for you

Whitney Albrecht

Joined: May 09, 2005
Posts: 19
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.

[ September 27, 2005: Message edited by: Whitney Albrecht ]
I agree. Here's the link:
subject: DispatchAction and html:cancel
It's not a secret anymore!