according this answer I try to write my code:
pojo:
class MyBean{
public String getValueName() {
return valueName;
}
public void
Your problem, I believe, is @ModelAttribute
. You're asking Spring to map the parameters to MyBean
object, and the property inside this object is valueName
.
In order Spring to reflect the params to the object, it needs to be in the correct case.
You have 2 options:
valuename
in your MyBean object, and all property names to lowercase, it should work with help of your solution.@ModelAttribute
and put @RequestParam
for each property. If you have many props, this could be painful.