Struts2-convention-plugin 0 Configuration

Source: Internet
Author: User

0 configuration does not mean that there is no configuration, but through the Convention is greater than the configuration of the way, a large number of conventions to schedule the page jump to make the configuration greatly reduced.

<?XML version= "1.0" encoding= "UTF-8"?> <!DOCTYPE struts Public "-//apache software foundation//dtd struts Configuration 2.1.7//en" "Http://struts.apach E.org/dtds/struts-2.3.16.dtd "><Struts>    <!--with the Convention plug-in, you'll need to put its jar file Convention-plugin in your app's Web-inf/lib directory, or you can add a bread dependency to your Maven project's pom file <dependen Cy> <groupId>org.apache.struts</groupId> <artifactid>struts2-convention-plugin</arti factid> <version>2.1.6</version> </dependency> -        <!--in development mode, the ability of the struts2 to dynamically reload the configuration and resource files takes effect by default. At the same time, the development mode will provide more perfect log support.  -    <constantname= "Struts.devmode"value= "true" />        <!--mainly used to set the request encoding (default value (UTF-8)), the head and the include tag resolution encoding. The parsed encoding of the resource and configuration file.  -    <constantname= "Struts.i18n.encoding"value= "UTF-8" />        <!--all of the default results pages are stored under Web-inf/content, and you can change the value of this property by setting the path to another -    <constantname= "Struts.convention.result.path"value= "/web-inf/page" />          <!--Custom JSP file-named delimiters -    <constantname= "Struts.convention.action.name.separator"value="_" />        <!--Configure the Convention plugin to automatically reload the map if the class file is automatically recompiled -    <constantname= "Struts.convention.classes.reload"value= "true" />        <!--whether to reload after struts.xml changes. The default value is False (used in a production environment), and the development phase is best opened -        <constantname= "Struts.configuration.xml.reload"value= "true"/>            <!--used to configure the class name suffix, the default is action, STRUTS2 will only go to the class with this suffix name to map -    <constantname= "Struts.convention.action.suffix"value= "Action" />        <!--set the suffix of the action request for struts, which is separated by commas when supporting multiple -    <constantname= "Struts.action.extension"value= ", shtml" />        <!--This indicates that the package path contains the action and actions that will be considered as the path to the existence of the action to search -    <constantname= "Struts.convention.package.locators"value= "Action,actions" />        <!--packages that are not scanned, used, segmented, included, will not be scanned as action -    <constantname= "Struts.convention.exclude.packages"value= "Com.lapp.service" />        <!--The root package for the scan, and the package is scanned for action -    <constantname= "Struts.convention.action.packages"value= "Com.lapp.action" />        <!--namespace definition: From the beginning of the. Package.locators flag to the end of the package, the namespace Com.ustb.web.user.userAction is: "/user". The Com.ustb.web.user.detail.UserAction namespace is: "/user/detail" -    <!--set Struts2 object factory, Default (struts) -    <constantname= "Struts.objectfactory"value= "Spring" />        <!--The default returns the result type search. Find out if the relevant dispatcher JSP file exists in order. Then find velocity and find freemarker,jsp. -    <constantname= "Struts.convention.relative.result.types"value= "dispatcher,velocity,freemarker,jsp" />         < Packagename= "Default"extends= "Struts-default">        <Interceptors>            <Interceptorname= "Logininterceptor"class= "Com.lapp.interceptor.AuthInterceptor" />            <!--Configure interceptor action with annotations: @InterceptorRef ("Loginstack") -            <Interceptor-stackname= "Loginstack">                <Interceptor-refname= "Logininterceptor" />                <Interceptor-refname= "Defaultstack" />            </Interceptor-stack>                    </Interceptors>        <Global-results>            <resultname= "Login"type= "Redirect">/login</result>        </Global-results>    </ Package> </Struts>

Struts2-convention-plugin 0 Configuration

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.