HTML: Cancel

Source: Internet
Author: User

HTML: Cancel tag to generate a Cancel button. When you click this button, Action servlet bypasses the validate () method of the corresponding form bean and gives the control to the corresponding action. In this action, you can use the action. iscancelled (httpservletrequest) method to determine whether the request has been canceled. If true is returned, the action is canceled. Otherwise, the action is not canceled.

Note that if you modify the property attribute value of the HTML: Cancel tag, the cancel detection mechanism provided by struts becomes invalid. You must provide a similar mechanism.

The following is the configuration file of the action that can be canceled. Note that the <set-Property = "cancellable" value = "true"/> line throws Org. apache. struts. action. invalidcancelexception exception. This is the only backward incompatible area I found during the completion of this Guide.

<Action Path = "/cancel"
Type = "org. Solo. Struts. Action. cancelaction" name = "cancelform"
Scope = "request">
<Set-Property = "cancellable" value = "true"/>
<Forward name = "success" Path = "/cancel. jsp"/>
</Action>
The code for the HTML: Cancel tag is as follows:

<HTML: Cancel> cancel The code in the corresponding action is as follows:

If (iscancelled (request )){
// What to do when action is canceled is written here
Return Mapping. findforward ("cancel ");
} Else {
// What to do when action is not canceled is written here
Return Mapping. findforward ("success ");
}

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/AWUSOFT/archive/2008/05/16/2452874.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.