Multiple @PathVariable in Spring MVC

后端 未结 1 772
忘了有多久
忘了有多久 2020-12-30 22:34

Couldn\'t find an answer to this unfortunately so hoping someone can help.

In Spring MVC 3.1.0 here is my method:

@RequestMapping(value = \"/{app}/co         


        
相关标签:
1条回答
  • 2020-12-30 23:24
    @RequestMapping(value = "/{app}/conf/{fnm}", method=RequestMethod.GET)
    public ResponseEntity<?> getConf(@PathVariable("app") String app, @PathVariable("fnm") String fnm) {
       log.debug("AppName:" + app);
       log.debug("fName:" + fnm);
               ...
               return ...
      }
    

    Basically path variables need to be specified with parentheses, in method arguments. Does this help?

    0 讨论(0)
提交回复
热议问题