File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes html:submit Vs html:cancel buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:submit Vs html:cancel buttons" Watch "html:submit Vs html:cancel buttons" New topic

html:submit Vs html:cancel buttons

Charanjit Sidhu

Joined: Apr 04, 2005
Posts: 13
Hi All,
I am new to Struts and am in the process of developing a new application in struts.
I read that the only difference between html:submit Vs html:cancel is that the later does not invoke the validate() method in the ActionForm associated with the page. But how can we know in the Action bean which was clicked (Submit or Cancel button)?

Also I want to know what is a good resource to learn the Struts taglibs.


Charanjit Sidhu<br />SCJP 81%
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

The action class provides and isCancelled() method you can call.

The developer guides from Struts are a good resource to understand each of the html tags.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Charanjit Sidhu

Joined: Apr 04, 2005
Posts: 13
Hi Jeanne,

Thanks so much for the 'Quick & To the point answers'.
This is my first question on this forum and am exited with the response!!!

I agree. Here's the link:
subject: html:submit Vs html:cancel buttons
It's not a secret anymore!