web.xml中welcome-file配置的问题
来源:互联网 发布:websock java 编辑:程序博客网 时间:2024/04/30 19:06
最近在搭建maven项目,刚开始配置了welcome-file的是jsp,没有什么问题,后来整合struts2,spring时写了一个测试action,当我将welcome-file改成action后,运行发现找不到文件,后来查了很多资料才知道。
welcome-file的只能只对serlvet,html,jsp。而struts2是用filter来做的所以无法识别,解决方案有3种。
1.网页重定向,在welcome-file中<welcome-file>index.jsp</welcome-file> ,在index.jsp中的meta写<
meta
http-equiv
=
"refresh"
content
=
"0;url=index.action"
>
2.网页跳转 在index.jsp的使用jsp:forword的标签跳转到index.action
3.在web.xml的welcome-file中直接写<welcome-file>index.action</welcome-file>,然后在项目的根目录下创建一个index.action的空文件就可以正常运行,
Ps:目前只在tomcat下可以运行(测试过),jetty中貌似不可以(有网友说的,未测试),建议还是使用第一种或者第二种
参考资料:http://www.jdiy.org/read.jd?id=y0hi94eg4l
http://yjshengshe.iteye.com/blog/641934
- web.xml中welcome-file配置的问题
- web.xml中<welcome-file-list>配置
- web.xml中配置的welcome-file 不生效
- web.xml 文件中welcome-file的元素
- web.xml 中 welcome-file 为action的解决
- 关于web.xml中<welcome-file-list>
- 关于web.xml中<welcome-file-list>
- 关于web.XML文件的welcome-file设置成 .do/.action问题
- web.xml里面的welcome-file-list是什么意思
- java web.xml welcome-file-list的默认值
- Jetty下web.xml的welcome-file-list无效
- java web.xml welcome-file-list的默认值
- web.xml中的welcome-file-list不起作用
- web.xml中的welcome-file-list
- web.xml中的welcome-file(访问相对路径时配置默认访问文件)
- springmvc中配置web.xml的问题
- welcome-file 不能配置action的解决方法
- web.xml之welcome-file-list、error-page
- eclipse编辑相关快捷键
- perl中数组的使用
- 关于制定计划
- 第三章 目标文件里有什么
- 如何查看80端口是否被占用_端口被占用解决办法
- web.xml中welcome-file配置的问题
- 【开源工具】Cppcheck 1.54 C/C++静态代码分析工具
- 从零开始,学习windows编程(3)—hello.c的疑惑
- HDU 2815 Mod Tree 解a^x = b(mod n)非互质
- 从零开始,学习windows编程(4)--从libc.lib开始
- 从零开始,学习windows编程(5)--修改入口不为mainCRTStartup
- 从零开始,学习windows编程(6)--改换entry,link错误的简单分析
- 从零开始,学习windows编程外篇(1)--分析lib文件
- C程序小结3