在我的应用程序中,我必须比较控制器中的 3 个产品,我将请求映射为
@RequestMapping(value = "/products/{proId1}Vs{proId2}Vs{proId3}", method = RequestMethod.GET)
public ModelAndView compareThreeProducts(@PathVariable("proId1") int id1, @PathVariable("proId2") int id2, @PathVariable("proId3") int id3)
{
//someLogic
当点击我的网址时(http://something/products/12Vs13Vs14)
我收到 http 400 错误
我还尝试了 2 @pathVariable 之类的
@RequestMapping(value = "/products/{proId1}Vs{proId2}", method = RequestMethod.GET)
public ModelAndView compareTwoProducts(@PathVariable("proId1") int id1, @PathVariable("proId2") int id2)
这工作正常,但为什么我面临 3 个变量的问题,而且服务器日志中也没有错误,那么如何找到问题所在。
有什么解决办法??