Hello and sorry for my english. In my form, i have 2 submit button. I manage the flow using LookupDispatchAction. This works fine and now i want add a cancel button.
If i code this buttons:
<html:submit property="action"><bean:message key="boton.insertarfavoritos"/></html:submit>
<html:submit property="action"><bean:message key="boton.otroejercicio"/></html:submit>
<html:cancel><bean:message key="boton.cancel"/></html:cancel>
throws an error:
Request[/altaejercicioSubmit] does not contain handler parameter named 'action'. This may be caused by whitespace in the label text.
I have created a new class Action for cancel button using LookupDispatchAction:
<html:cancel property="action"><bean:message key="boton.cancel"/></html:cancel>
but then the form validation shows all empty fields.
I have seen the html:cancel documentation:
WARNING - If you set this attribute to a value other than the default, this will NOT be recognized as the cancel key by the
Struts controller
servlet or the Action.isCancelled() method. You will need to do your own cancel detection.
But i don�t understand. In a normal form with one submit button and one cancel button, in the Action i put:
if (isCancelled(request)){
return(mapping.findForward("mainmenu"));
}
How can i use a html:cancel button using LookupDispatchAction?