Provide option to disable binding HTTP headers to model attribute properties #33961
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: duplicate
A duplicate of another issue
In Spring 6.2, ExtendedServletRequestDataBinder was updated to bind HTTP headers to model attribute properties. This breaks some forms where property names happen to match the names of unrelated HTTP headers. For example, I have a form with a "Priority" field that gets bound to a "priority" property in my model object. This field allows values of "P1," "P2," "P3," "P4," "P5," and blank. When the value is left blank, however, Spring binds the Priority header to this property. The header value does not conform to the set of valid values for this property and, thus, triggers a validation error. This issue is to request that this new header-binding functionality be made optional (either via a global configuration property or via a new parameter on the @validated annotation).
The text was updated successfully, but these errors were encountered: