Hi,
I have a problem with the @ModelAttribute and @SessionAttributes usages.
Basically, I have a JSP with a form and a controller with the related form backing bean and I want to modify the value in the form, refresh the page (with Javascript) and show the new value in the same page.
The problem is that the value of the form backing bean does not change if I modify the value in the form and I refresh the page (I have always the first value)...
This is my controller:
And my JSP looks like:Code:@Controller @SessionAttributes(value = {"value"}) public class FindValuesForm { private final ValueDto value; public FindValuesForm(){ this.value = new ValueDto(); } ... @RequestMapping(value = "/find.do", method = RequestMethod.GET) public String setupForm(ModelMap model){ ... model.addAttribute("value", this.value); return "find"; } @RequestMapping(value = "/find.do", method = RequestMethod.POST) public String processSubmit( @ModelAttribute("value") ValueDto value, BindingResult result, ModelMap model) { ... // Use the value object }
I don't know how to solve this problem...Code:<form:form name="form1" modelAttribute="value"> ... <c:out value="value: ${value.id_value}"/> </form:form>
Any idea?
Thanks!
BYE![]()


Reply With Quote
