Skip to content

Add support for non-public record declarations #27437

@joshlong

Description

@joshlong

This might be possible, and I just couldn't find the documentation or make it work, but in essence it feels like it should be possible to bind form payloads to a Java 14 record via the constructor

record Greeting(String name){}

@Controller 
class GreetingsMvcController {

  @PostMapping ("/greetings") 
  void submit (@ModelAttribute Greeting greeting) { 
    System.out.println( "the name is " + greeting.name()) ; 
  }
}

Thanks for your consideration, and I apologize if this has already been solved.

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions