Issue 213, writing init binder to convert null Boolean values to false before calling setters

pull/263/head
Amanda Anganes 2012-11-20 10:22:56 -05:00
parent f50726ab31
commit 8b0c520534
1 changed files with 21 additions and 0 deletions

View File

@ -169,6 +169,27 @@ public class ClientDynamicRegistrationEndpoint {
}); });
} }
//TODO: this is a stub, make it work
@InitBinder({"require_auth_time"})
public void authTimeInitBinder(WebDataBinder binder) {
/*
* Space-separated set of strings
*/
binder.registerCustomEditor(Boolean.class, new PropertyEditorSupport() {
@Override
public void setValue(Object obj) {
if (obj != null) {
setValue(obj);
}
else {
setValue(false);
}
}
});
}
@RequestMapping(params = "type=client_associate", produces = "application/json") @RequestMapping(params = "type=client_associate", produces = "application/json")
public String clientAssociate( public String clientAssociate(
@RequestParam(value = "contacts", required = false) Set<String> contacts, @RequestParam(value = "contacts", required = false) Set<String> contacts,