You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kenny MacLeod added a comment - 13/Dec/07 12:05 PM
Alternatively, perhaps @RequestParam could take an optional "defaultValue" attribute? It'd have to be a string, subject to the same conversion rules as if the parameter had been present. This would work for primitives as well as reference types.
Connor Barry added a comment - 24/Oct/08 01:36 AM
I agree, a defaultValue attribute would be really helpful here, to mimic the set of functions in ServletRequestUtils that allow a default to be set if it's not present, for example:
ServletRequestUtils.getBooleanParameter(request, name, defaultVal)
Kenny MacLeod opened SPR-5237 and commented
From #8915:
Kenny MacLeod added a comment - 13/Dec/07 12:05 PM
Alternatively, perhaps
@RequestParam
could take an optional "defaultValue" attribute? It'd have to be a string, subject to the same conversion rules as if the parameter had been present. This would work for primitives as well as reference types.Connor Barry added a comment - 24/Oct/08 01:36 AM
I agree, a defaultValue attribute would be really helpful here, to mimic the set of functions in ServletRequestUtils that allow a default to be set if it's not present, for example:
ServletRequestUtils.getBooleanParameter(request, name, defaultVal)
Affects: 2.5 final
Issue Links:
@RequestParam
fails on missing parameterReferenced from: commits 0012c1e
The text was updated successfully, but these errors were encountered: