Spring MVC3 默认页面(welcome-file)问题
来源:互联网 发布:sharpdesk软件 编辑:程序博客网 时间:2024/04/30 15:42
<servlet><servlet-name>spring3mvc</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/conf/spring3mvc.xml</param-value></init-param><load-on-startup>1</load-on-startup>
</servlet> <servlet-mapping> <servlet-name>spring3mvc</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
设置了/拦截后会对所有的进行过滤(静态资源可以在<mvc:resources/>上设置),但默认页面如http://localhost:8080/appnm 一般是会去welcome页面(welcome-file-list中配置),但也是被拦截,导致404页面找不到。
一种方法是配置一个Controller,其mapping是"",这样http://localhost:8080/appnm就会被该controller捕获到。
/** * 默认页 * @author wangzejie * */@Controller@RequestMapping("")public class IndexController {@RequestMapping("")public String index(HttpServletRequest request, HttpServletResponse response) throws IOException {return "index";}}
0 0
- Spring MVC3 默认页面(welcome-file)问题
- Spring MVC <welcome-file-list> 问题
- spring MVC的controller控制welcome-file-list里页面访问的问题
- spring mvc3处理默认请求
- Tomcat设置<welcome-file>显示首页问题
- Spring MVC3.0乱码问题
- 关于springmvc框架下tomcat6和tomcat7不配置welcome-file-list跳转到第一个页面的问题
- Jsp welcome-file-list欢迎页面,首先访问Servlet.
- Spring MVC RESTful风格URL welcome-file-list不起作用问题解决
- Struts关于welcome-file index.do设置问题
- web.xml中welcome-file配置的问题
- welcome-file-list
- welcome-file-list
- <welcome-file-list>404
- welcome-file-list元素
- welcome-file-list不起作用
- welcome-file-list不起作用
- <welcome-file-list>
- 【C实现简易内存数据库】4、create实现
- 链队列的基本操作
- OpenNMS技术分析与扩展开发
- 2013-12-23 17:32:05
- 看懂SQL SERVER执行计划
- Spring MVC3 默认页面(welcome-file)问题
- 字符串函数
- Ubuntu上安裝JDK
- 在Eclipse中使用JDBC连接SQL Server 2005 Express
- 人生
- python +wsgi
- Java项目中如何读取工程的绝对路径
- linux 查看 cup 信息
- 历史上关于struts2 遍历Map最全的总结