Struts2 Default Interceptor Defaultstack

Source: Internet
Author: User

The first time using Struts2.3.20, the foreground page to the background value, how always prompt value is null, find half a day originally was the Struts configuration file action forgot to introduce the defaultstack interceptor, so even if the action of Everything ( Package parameters of getter and setter), or can not achieve the desired results.

Use a custom interceptor to configure the action in the struts profile to also introduce Defaultstack, otherwise the Formbean using Modeldriven will not be able to get the value of the field in the form form.

< Packagename= "Defaults"extends= "Json-default">        <Interceptors>            <Interceptorname= "Methodinterceptor"class= "Methodinterceptor"></Interceptor>            <Interceptorname= "Logininterceptor"class= "Logininterceptor"></Interceptor>            <Interceptor-stackname= "Loginstack">                <Interceptor-refname= "Methodinterceptor"></Interceptor-ref>                <Interceptor-refname= "Logininterceptor"></Interceptor-ref>                <Interceptor-refname= "Defaultstack"></Interceptor-ref>            </Interceptor-stack>        </Interceptors>                    <Global-results>            <resultname= "Error"type= "Redirect">/405.jsp</result>            <resultname= "Toindex"type= "Redirect">Index</result>            <resultname= "Tologin"type= "Redirect">Login</result>        </Global-results>    </ Package>

Struts2 Default Interceptor Defaultstack

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: 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.