【发布时间】:2016-08-01 14:18:02
【问题描述】:
我正在使用以下 URL 发送请求,但收到 404 错误。 在服务器上出现警告:找不到带有 URI 的 HTTP 请求的映射
URI 是
http://localhost:8080/webstore/products/tablet/price;low=200;high=400?manufacturer="谷歌"
使用的控制器中的方法是
@RequestMapping(value="/products/{category}/{ByCriteria}",method=RequestMethod.GET)
public String getSpecificProductByFilter(@PathVariable("category")String ProductCategory,@MatrixVariable(pathVar= "ByCriteria") Map<String,List<Long>> filterParams,@RequestParam String manufacturer,Model model){
model.addAttribute("products",productService.getfilterproducts(ProductCategory,filterParams, manufacturer));
return "products";
}
类别在 URI 中表示“平板电脑”
标准表示“低”和“高”
制造商是“google”
【问题讨论】:
-
你的映射如果是
/product/...,但你的实际路径是/products/...。这里的s不会被 Spring 神奇地忽略。 -
@JBNizet 我已经相应地改变了路径,但我面临着我之前面临的同样的问题
-
你能发布 web.xml 吗?
-
我以类似的方式尝试过一切对我来说都很好。可能还有其他问题
标签: spring spring-mvc