DataBinder using constructor parameter should use path variables #22748
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
When the
DataBinder
uses setters it uses request parameters and path variables to fill the object. 😃Given a class
Customer
:and a class
CustomerController
:when you do a POST request to
localhost:8080/customers/1?name=rod
, theCustomer
is nicely filled and1:rod
appears on the console.When the
DataBinder
uses a parametrized constructor it does not use path variables. 😟Given a class
Supplier
:and a class
SupplierController
:when you do a POST request to
localhost:8080/suppliers/1?name=rod
, you getjava.lang.NoSuchMethodException: org.example.databinder.Supplier.<init>()
.The text was updated successfully, but these errors were encountered: