How to prevent parameter binding from interpreting commas in Spring 3.0.5?

后端 未结 6 1862
抹茶落季
抹茶落季 2020-11-28 06:37

Consider the following controller method:

@RequestMapping(value = \"/test\", method = RequestMethod.GET)
public void test(@RequestParam(value = \"fq\", requi         


        
6条回答
  •  攒了一身酷
    2020-11-28 07:01

    Its a hack but, have you considered passing your params delimited with '-'

    /test?fq=foo-bar results in fq = foo-bar
    /test?fq=foo-bar&fq=bash results in fq = foo-bar|bash 
    

    Or any other delimiter maybe ~, or !,or ^, or ???

提交回复
热议问题