And the various default values in the configuration

Source: Internet
Author: User

Java EE Development of various resources download list, the history of the most IT resources, personal collection summary.


Properties in <action>:

Name: Must have

Class: If this property is not specified or the value of this property is "" empty string: The default is Com.opensymphony.xwork2.ActionSupport

In Actionsupport.java:

public class Actionsupport implements Action,... {

public static final String SUCCESS = "SUCCESS";

Public String Execute () throws Exception {
return SUCCESS;
}

}

Method: If this property is not specified or the value of this property is "" empty string: The default is Execute

properties in <result>:

Name: If this property is not specified or the value of this property is "" empty string, the default is success

Type: If this property is not specified or the value of this property is "" empty string, the default value is dispatcher (forward)


  So the following code is also possible:
  <struts>
   <package name= "Itstar" namespace= "/ Attribute "extends=" Struts-default,
       <action name= "Default";
          <result name= "Success" >/page/ default1.jsp </result>
       </action>
        <action name= "Default";
          <result Name= "Success" Type= "" >/page/ default2.jsp </result>
           <result name= "Success" >/page/ default3.jsp </result>
       </action>
       
   </package>
</struts>

when entered on the browser: Http://localhost:8080/Struts2_02/attribute/default

and configure the default values in the >

This proves that when the name attribute value of <action> or <result> is the same, the following <action> or <result> overrides the previous <action> or < Result>, from the above results can be seen

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.