This label is used to create a URL. You can use the <param> sub-label to add request parameters to the URL. If the parameter is an array or a set, all the values in it 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: //
The following are three small examples provided on the official struts2 website.
<-- Example 1 --> <s:url value="editGadget.action"> <s:param name="id" value="%{selected}" /> </s:url> <-- Example 2 --> <s:url action="editGadget"> <s:param name="id" value="%{selected}" /> </s:url> <-- Example 3--> <s:url includeParams="get"> <s:param name="id" value="%{'1'}" /> </s:url>Then, we can use a <s: a> label, which is very nice, for example
<S: a href = "% {url}"> derek lab </s: a> can implement the url and redirect with parameters ~