Struts2 default interceptor defastack stack, struts2 default interceptor
When Struts2.3.20 is used for the first time, the foreground page transmits a value to the background. How can I always prompt that the value is null? I forgot to introduce the defaultStack interceptor in the action of the struts configuration file for a long time, therefore, even if everything in the Action (the getter and setter of the encapsulated parameter are both ready, the expected effect still cannot be achieved.
Use the custom Interceptor to configure it in the action of the struts configuration file and introduce defastack stack. Otherwise, the formBean that uses modelDriven cannot obtain the value of fields in the form.
<package name="defaults" extends="json-default"> <interceptors> <interceptor name="methodInterceptor" class="methodInterceptor"></interceptor> <interceptor name="loginInterceptor" class="loginInterceptor"></interceptor> <interceptor-stack name="loginStack"> <interceptor-ref name="methodInterceptor"></interceptor-ref> <interceptor-ref name="loginInterceptor"></interceptor-ref> <interceptor-ref name="defaultStack"></interceptor-ref> </interceptor-stack> </interceptors> <global-results> <result name="error" type="redirect">/405.jsp</result> <result name="toIndex" type="redirect">index</result> <result name="toLogin" type="redirect">login</result> </global-results> </package>