Hi, there:
I have a question regarding the submit and cancel button using the
<html:submit> and <html:cancel> tag in a form. In the FormAction class, how do I tell whether the user clicked on the submit or the cancel button? Seems to me that either the user clicked on the submit or the cancel, the code that is in perform method of the action class would be executed. Could sb give any hints?
Thanks.
sanjay
-
cancel by struts (1 messages)
- Posted by: sanjay parihar
- Posted on: November 19 2001 04:17 EST
Threaded Messages (1)
- cancel by struts by Jason McKerr on November 19 2001 12:10 EST
-
cancel by struts[ Go to top ]
- Posted by: Jason McKerr
- Posted on: November 19 2001 12:10 EST
- in response to sanjay parihar
yes, these go to the perform method of the action class.
You can check the request for submit if you want to do various processing based on that. For cancel, you can use
something like
if (isCancelled(request))
return mapping.findForward("back");
I guess also, you could use htm:button tag with onclick
method doing a window.location= type of thing. I hate javascript though.
-Newt