Optional parameter in web method now raises error, breaks compatibility with the past [SPR-10584] #15213
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: duplicate
A duplicate of another issue
Alex opened SPR-10584 and commented
A sample method defined as follows:
@RequestMapping
(value = "/test")public String testMethod(Integer n) {
if (n == null)
// do something
else
// do something else
}
stopped working in Spring 3.2.3 (works fine up to 3.2.2) because calling the url like:
http://hostname/context/test?n=
raises a MissingServletRequestParameterException while it should not (it should put a null in n) breaking completely the compatibility with existing apps.
Affects: 3.2.3
Issue Links:
@RequestParam
not enforced with empty values0 votes, 5 watchers
The text was updated successfully, but these errors were encountered: