-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Scott Battaglia opened SPR-5410 and commented
I'm using the Spring MVC's annotation-based support and specified a method signature as follows:
public void validateCas10Request(@RequestParam(value="renew",required=false) final boolean renew, @RequestParam(value="service",required=true) final String service, @RequestParam(value="ticket",required=true) final String ticket, final Writer writer) {
If I do not have a renew request parameter the following error is thrown:
java.lang.IllegalStateException: Optional boolean parameter 'renew' is not present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.
Is there a reason that a null parameter is not converted to false, as per the JavaDoc's parseBoolean method for Boolean?
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Boolean.html#parseBoolean(java.lang.String)
Affects: 2.5.6