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
  • 2,001
  • 6
  • 25
  • 38

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,551
  • 2
  • 41
  • 72