ssm框架整合时遇到的问题
来源:互联网 发布:左轮吉他淘宝店怎么样 编辑:程序博客网 时间:2024/06/04 19:59
这是我在整合struts2,mybatis,spring时遇到的一些问题,在此分享出来,并记录下来供参考.
第一个问题和解决方式:
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. 异常
异常信息:The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag.
-----这是由于添加了struts的标签后引起的
在web.xml的配置
<filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>*.action</url-pattern></filter-mapping>
默认是*.action过滤
引入struts标签后,出现这种异常,归纳以下有三种解决方法:
1:将web.xml下struts过滤器的过滤方式*.action改为/*;这样会默认对所有的进行过滤,自我感觉不是很好.
2:在页面不使用struts标签.
3:再加一个过滤方式
<filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.jsp</url-pattern></filter-mapping><filter-mapping><filter-name>struts2</filter-name><url-pattern>*.action</url-pattern></filter-mapping>
推荐使用第三个方式!!!
0 0
- ssm框架整合时遇到的问题
- SSM框架整合中遇到的问题汇总
- SSM整合中遇到的问题总结
- js+ssm框架整合的一些问题
- ssm框架整合的一些问题集合
- SSM(Spring+SpringMVC+MyBatis)三大框架整合及遇到的各种问题
- SSM三大框架整合Springfox(Swagger2)步骤以及遇到的一些问题
- maven配置SSM框架整合 其中包括maven在使用过程中遇到的问题
- SSM框架搭建,及遇到的问题
- idea搭建SSM框架遇到的问题
- SSM整合遇到问题随笔
- SSM框架的整合
- SSM框架的整合
- SSM框架的整合
- ssm框架的整合
- SSM框架的整合
- SSM框架的整合
- ssm框架的整合
- 判断一个字符串中出现次数最多的字符,并统计这个次数
- zend studio 安装 emmet aptana3地址
- mysql中的select into 与insert into语句用于备份数据
- mac系统启动startup.sh tomcat启动失败问题!
- 深入理解Android之Xposed详解
- ssm框架整合时遇到的问题
- tar:time stamp in the future
- HelloWorld工程项目解析(四)
- React-Native 学习笔记十七(网络请求)
- 从头越-万里长征里
- 国内首位通过HCIE-Storage V1.6新版LAB者考试心得
- 编写BUG报告有诀窍?Toulmin模型来帮忙
- go beego模板嵌套list
- [剑指offer学习心得]之:栈的压入、弹出序列