1. 程式人生 > >struts攔截所有action的低階錯誤,繼承BASEACTION導致報錯

struts攔截所有action的低階錯誤,繼承BASEACTION導致報錯

@ParentPackage("default")

在子類的action中增加以上即可

很少與其他人合作,合版本。。。。

補充:

	<package name="default" extends="struts-default">
		<interceptors>
		    <interceptor name="authority" class="com.hansci.cms.action.authority.UserAuthorityInterceptor"/>
			<interceptor-stack name="baseStack">

                <interceptor-ref name="exception" />
                <interceptor-ref name="alias" />
                <interceptor-ref name="servletConfig" />
                <interceptor-ref name="i18n" />
                <interceptor-ref name="prepare" />
                <interceptor-ref name="chain" />
                <interceptor-ref name="debugging" />
                <interceptor-ref name="scopedModelDriven" />
                <interceptor-ref name="modelDriven" />
                <interceptor-ref name="fileUpload" />
                <interceptor-ref name="checkbox" />
                <interceptor-ref name="multiselect" />
                <interceptor-ref name="staticParams" />
                <interceptor-ref name="actionMappingParams" />
                <interceptor-ref name="params">
					<param name="excludeParams">dojo\..*,^struts\..*</param>
                </interceptor-ref>
                <interceptor-ref name="conversionError"/>
                <!-- 配置方法級別的校驗 -->
                <interceptor-ref name="validation">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                    <param name="validateAnnotatedMethodOnly">true</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
                <interceptor-ref name="defaultStack"/>
                <interceptor-ref name="authority"/>
            </interceptor-stack>
		</interceptors>
		<!-- 配置預設攔截器棧 -->
		<default-interceptor-ref name="baseStack" />