1.web.xml中拦截的url设置为/来让sping mvc 处理
2.Restful风格(@PathVariable("参数"))
3.对静态资源的处理
在spring-mvc.xml中添加
<mvc:annotation-driven/>
<mvc:resources mapping="/resources/**" location="/images/"/>
<mvc:resources mapping="/resources2/**" location="/css/"/>
4.如要使用images下的图片在jsp页面中可以:
<img alt="文章列表" src="${pageContext.request.contextPath}/resources/article_list.jpg">
如果使用css样式
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources2/css.css"/>
</head>