when I try to map Boolean value from url to spring controller, it always map to false.
This is my url
http://localhost:8080/myurl?isFirstTime=true
here is my controller
@RequestMapping(value = "/myurl", method = RequestMethod.GET)
public ResponseEntity<?> getMyUrl(@Valid @ModelAttribute MyObject ap,BindingResult bindingResult ) {
//here isFirstTime is always set to false
}
MyObj
is POJO and has several other attributes which are mapping perfectly
public class Myobj{
private boolean isFirstTime
//there are other members as well
//getter setter
i tried putting @JsonProperty
but that also didn't work
@JsonProperty
private boolean isFirstTime
any idea what am I doing wrong here ?