自定义拦截器没有加载
来源:互联网 发布:程序员怎么挣钱 编辑:程序博客网 时间:2024/06/05 18:20
写拦截器时,自己定义的拦截器总是不加载,
出现过的错误如下
- 元素类型为 “struts” 的内容必须匹配 “((package|include|bean|constant)*,unknown-handler-stack?)”。 at (null:13:10)
错误代码如下
<struts><interceptors> <interceptor name="MyInterceptor" class="org.interceptor.MyInterceptor"></interceptor></interceptors><package name="default" extends="struts-default"> <action name="test123" class="org.action.TestAction"> <interceptor-ref name="defaultStack"></interceptor-ref> <interceptor-ref name="MyInterceptor"></interceptor-ref> <result name="success">/MyJsp.jsp</result> </action></package></struts>
因为我把
<interceptors> <interceptor name="MyInterceptor" class="org.interceptor.MyInterceptor"></interceptor>
这段写在package外面的,所有出错了
更正,写在package里面就好了
<struts><package name="default" extends="struts-default"><interceptors> <interceptor name="MyInterceptor" class="org.interceptor.MyInterceptor"></interceptor></interceptors> <action name="test123" class="org.action.TestAction"> <interceptor-ref name="defaultStack"></interceptor-ref> <interceptor-ref name="MyInterceptor"></interceptor-ref> <result name="success">/MyJsp.jsp</result> </action></package></struts>
然后出现了
- Could not find action or result No result defined for action org.action.TestAction and result success
因为我的action的name写的是test,后来改成test123,可以了
到目前为止我遇到的这种有login,test
0 0
- 自定义拦截器没有加载
- Struts2自定义拦截器(实现没有登录情况下只能访问登录页面)
- struts2 自定义拦截器
- 自定义拦截器(转)
- Struts2自定义拦截器
- 自定义拦截器
- Struts2自定义拦截器
- strust2自定义拦截器
- 自定义时间拦截器
- struts2自定义拦截器
- Struts2自定义拦截器
- 拦截器(自定义)
- Struts2自定义拦截器
- Struts2自定义拦截器
- 自定义异常拦截器
- Struts2自定义拦截器
- struts2自定义拦截器
- 自定义拦截器
- 利用Disk Genius分区工具给电脑硬盘进行分区详细图文教程
- 基于Solr的空间搜索学习笔记
- Android程序去除标题栏
- 160. Intersection of Two Linked Lists
- PHP——函数_学习笔记
- 自定义拦截器没有加载
- HDU 4587 (割点)
- C/C++用new、delete分配回收堆中空间
- 特殊的String
- 随机梯度下降
- 数论之最大公约数和最小公倍数
- Android:Fragment 与 ViewPager的配合使用
- ViewPager导航图片——简单实现方法
- 单链表反转