2
我的控制器的映射:Spring MVC的控制器映射的正则表达式
@RequestMapping(value = "{objectId}/{objectName: [a-zA-Z-]+}", method = GET)
public String getObjects(@PathVariable Integer objectId, Model model) { ... }
@RequestMapping(value = "{objectId}/{objectName: [a-zA-Z-]+}_{category}", method = GET)
public String getObjectsForCategories(@PathVariable Integer objectId,
@PathVariable String category,
Model model) { ... }
,并且URL我打:
春找不到处理程序并抱怨H没有找到映射TTP请求。
删除'之间的空间:和''regex'并再试一次。 –