Spring MVC referencing params variable from RequestMapping

后端 未结 2 1026
情话喂你
情话喂你 2020-12-28 15:29

I have the method below:

@RequestMapping(value = \"/path/to/{iconId}\", params=\"size={iconSize}\", method = RequestMethod.GET)
public void webletIconData(@P         


        
2条回答
  •  再見小時候
    2020-12-28 16:05

    axtavt is right

    I only want to explain what your mistake is:

    The @RequestMapping params parameter is a filter to make sure that the annotated handler method is only invoked if there is a parameter with the requested value.

    So a handler method annotated with @RequestMapping(params="action=doSomething") will be only invoked if there is an request parameter actionwith the content doSomething.

提交回复
热议问题