Example of submitting multiple requests in a form in struts2

Source: Internet
Author: User
Tags html form requires

In many Web applications, there may be two or more submit buttons in an HTML form tag in order to do different things, and Struts2 provides another way to perform a different method in the same action class without the need to configure ( The Execute method is performed by default)

Using this method also requires the request parameter to specify the action to be performed. The request parameter name is in the format

Action!method.action

Note: Since Struts2 only requires a parameter name, the parameter value is anything.

Here's an example program that shows how to handle a form with multiple submit:

Main Page more_submit.jsp

Moresubmitaction.java

Structs.xml

result.jsp

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.