1

I should create a Get service (using spring boot) with a lot of parameters.
I want to bind these parameters directly to my bean with @ModelAttribute.
The problem: there is some differences between fields in the bean and the Get parameters.
Example:

So for idPart there is no problem, but for formId the value is not mapped.
Is there any Spring annotation that map the formId field to form_id parameter?

Med Besbes
  • 1,941
  • 6
  • 23
  • 37

1 Answers1

1

I don't think there is any build in annotation for that. The easiest way would be to add setter in your been if you can do that

public void setForm_id(String formId) {
    this.formId = formId;
}

But you probably can look at other options https://stackoverflow.com/a/16520399/1032167

varren
  • 14,228
  • 2
  • 38
  • 69