Skip to content

Add support for @BeanParam like JAX-RS in Spring MVC [SPR-17237] #21770

Closed
@spring-projects-issues

Description

@spring-projects-issues

Ankur Pathak opened SPR-17237 and commented

We can collect various parameters of HTTP Request like Path, Query, Header inside bean using @BeanParam in JAX-RS.

public class MyBean {

  @FormParam("myData") private String data;

  @HeaderParam("myHeader") private String header;

  @PathParam("id") public void setResourceId(String id) {
    // ...
  }

  // ...

}

We should have something similar to same in Spring to collect them inside Bean and also apply Bean Validation API for them at once. Listing all those parameters as method parameter list is inelegant way of handling them and does not allow to transfer them at once from one layer to other layer.


Affects: 5.1 RC2

Reference URL: https://docs.oracle.com/javaee/7/api/javax/ws/rs/BeanParam.html

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions