前台代码:
<h3>RestFul风格</h3>
<a href="${pageContext.request.contextPath}/request/product2/100004559325.html">
<img alt="" src="${pageContext.request.contextPath}/20s.jpg" width="150px">
</a>
后台代码
@RequestMapping("/product2/{productId}.html")
public ModelAndView product2(@PathVariable("productId") Long productId){
System.out.println(productId);//100004559325
return null;
}
浏览器访问地址
http://localhost:8080/05Restful_war_exploded/request/product2/100004559325.html