ITeye博客

SpringMVC

共 1 篇文章

SpringMVC项目设置欢迎首页路径

还是前两天写的小程序,使用MVC架构,展示层使用的是SpringMVC框架。 以前使用SpringMVC,没有考虑到首页的路径,这次想到了这个问题。 百度一下,找到了我想要的答案, 假设我们的项目名称是demo,要映射localhost:8080/demo/user/add请求,在Controller中使用@RequestMapping("/user/add")就可以映射请求,但是,要映射localhost:8080/demo/请求的话,在Controller中使用@RequestMapping("/")是映射不到请求的,而会走web.xml中的配置文件,如果没有web.xml中配置的默认的…

2014-11-11 00:11 · SpringMVC · SpringMVC · 路径 · web.xml · 拦截 · 首页