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'並再試一次。 –