The content of element type "package" must match "(result-types?,interceptors?,default-intercept .
2014-04-03 10:04
417 查看
在编写后台登陆模块时,将许多默认的设置放在一个名为default的package
里。然后再定义其他package继承该包。之前我的struts.xml配置如下
<struts>
<constant
name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory"
/>
<constant
name="struts.devMode" value="true" />
<package
name="exam_default" extends="struts-default" namespace="/">
<!--自定义拦截器及拦截器栈-->
<interceptors>
<!--用户认证拦截器-->
<interceptor
name="authentication" class="action.admin.AuthenticationInterceptor"/>
<!--用户认证拦截器栈,用于防止用户非法访问-->
<interceptor-stack
name="user" >
<interceptor-ref
name="authentication" />
<interceptor-ref
name="defaultStack"/>
</interceptor-stack>
<interceptor-stack
name="guest" >
<interceptor-ref
name="defaultStack"/>
</interceptor-stack>
</interceptors>
<!--全局异常映射-->
<global-exception-mappings>
<exception-mapping
result="error" exception="java.lang.Exception"/>
</global-exception-mappings>
<!--全局result-->
<global-results>
<result
name="error">/error.jsp</result>
</global-results>
</package>
<package
name="admin" extends="exam_default" namespace="/admin">
<action
name="login" class="login">
<result
type="redirectAction">index</result>
里。然后再定义其他package继承该包。之前我的struts.xml配置如下
<struts>
<constant
name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory"
/>
<constant
name="struts.devMode" value="true" />
<package
name="exam_default" extends="struts-default" namespace="/">
<!--自定义拦截器及拦截器栈-->
<interceptors>
<!--用户认证拦截器-->
<interceptor
name="authentication" class="action.admin.AuthenticationInterceptor"/>
<!--用户认证拦截器栈,用于防止用户非法访问-->
<interceptor-stack
name="user" >
<interceptor-ref
name="authentication" />
<interceptor-ref
name="defaultStack"/>
</interceptor-stack>
<interceptor-stack
name="guest" >
<interceptor-ref
name="defaultStack"/>
</interceptor-stack>
</interceptors>
<!--全局异常映射-->
<global-exception-mappings>
<exception-mapping
result="error" exception="java.lang.Exception"/>
</global-exception-mappings>
<!--全局result-->
<global-results>
<result
name="error">/error.jsp</result>
</global-results>
</package>
<package
name="admin" extends="exam_default" namespace="/admin">
<action
name="login" class="login">
<result
type="redirectAction">index</result>
相关文章推荐
- The content of element type "package" must match "(result-types?,interceptors?,default-intercept .
- 报错:“The content of element type "package" must match "(result-types?,interceptors?,default-intercept
- The content of element type "package" must match "(result-types?,interceptors?,default-intercept .
- 错误:“The content of element type "package" must match "(result-types?,interceptors?,default-intercept
- The contenTht of element type "package" must match "(result-types?,interceptors?,default-intercept .
- The content of element type "package" must match "(result-types?,interceptors?,default-intercept
- The content of element type "package" mustmatch "(result-types?,interceptors?,default-interceptor-re
- “The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-
- struts2---The content of element type "package" must match "(result-types?,interceptors?,default-int
- struts2---The content of element type "package" must match "(result-types?,interceptors?,default-int
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-r
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-r
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-r
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global- results?,global-exception-mappings?,action*)".
- The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-r
- 如果出现The content of element type "package" must match "(result-types?,interceptors?,default-interce
- struts2---The content of element type "package" must match "(result-types?,interceptors?,default-int
- “The content of element type "package" must match "(result-types?,interceptors?,
- The content of element type "package" must match "(result-types?,interceptors?...
- The content of element type "package" must match "(result-types?,interceptors?...