Usage of the (s: url) label in struts2

Source: Internet
Author: User

This label is used to create a URL. You can useThis sub-tag adds Request Parameters for the URL. If the parameter is an array or set, all values will be used as parameters.

Several important attributes:

Action (String): The name of an action, which has the same role as the value attribute. If both exist, value has a priority.

Value (String): This attribute must be consistent with the action name in struts. xml.

Method (String): The specific method name in action. The default value is execute.

IncludeParams (String): This attribute has three values: none (default), get, and all. none indicates that the url does not contain any parameters, but you can add parameters to the url using the param subtag; get indicates that the url contains parameters submitted in GET mode. For example, the jsp page of the url tag is http :// : / /EditUser. action? Id = 168 & name = derek, but it can be overwritten by the param sub-tag. As in example3 below, the url will change to http :// : / /EditUser. action? Id = 1 & name = derek; post indicates the parameters in the url that contain the GET and POST request methods.


The following are three small examples provided on the official struts2 website.

<-- Example 1 --> 
      
   
  <-- Example 2 --> 
      
   
  <-- Example 3--> 
      
   
 
Then Labels are very nice, such

Derek lab The url can be implemented, with the jump of parameters ~


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.