The test case given below shows a simple case where I have 2 parameters paramA and paramB.
- If I call the
/paramtesturl theparamtest()method is called. - If I enter
trueforparamA, methodaTrue()is called. - However, when I enter
truefor bothparamAandparamBthe methodbTrueNotA()is called.
But the 3rd @RequestMapping calls for A=True and B!=true. By my reconing when both parameters are true, aTrue() should be called.
@RequestMapping("paramtest")
@ResponseBody
public String paramtest(){
return "<html><head></head><body>" +
"<form action=paramtest method=post>" +
"paramA: <input type=text name=paramA /><br>" +
"paramB: <input type=text name=paramB /><br>" +
"<input type=submit>" +
"</form>" +
"</body></html>";
}
@RequestMapping(value="paramtest", params="paramA=true")
@ResponseBody
public String aTrue(){
return "A=true";
}
@RequestMapping(value="paramtest", params={"paramB=true", "paramA!=true"})
@ResponseBody
public String bTrueNotA(){
return "B=True; A!=true";
}