Optional path variables in Spring-MVC RequestMapping URITemplate

后端 未结 4 1319
暖寄归人
暖寄归人 2021-02-20 12:10

I have the following mapping:

@RequestMapping(value = \"/{first}/**/{last}\", method = RequestMethod.GET)
public String test(@PathVariable(\"first\") String firs         


        
4条回答
  •  [愿得一人]
    2021-02-20 12:59

    try to use this

    @RequestMapping(value = {"some mapped address","some mapped address with path variable","some mapped address with another path variable"})
    

    array list of available url for specific method

    But be careful on creating list of url when you are using @PathVariable in your method signature it cant be null.

    hope this help

提交回复
热议问题