posted 9 years ago
I have a very simple controller and two views, a form and a thank you view. The form() method in the controller (mapped to the URL /form.do binds a new Member domain object (containing first and last name strings) to a form bean and returns it to the form.jsp page. The form.jsp page then is used to fill in the first and last names and submits to the controller's proecessFormData() method. This then puts the Member object passed to it into the Model and returns to the Thanks.jsp page. When I fill in the data on the form.jsp page and submit, I can see from the log statement in the processFormData() method of the controller that the first and last name are coming through correctly, my form data is getting to the controller properly. Also the processFormData() correctly returns to the thanks.jsp view (thanksViewName is set to "thanks"). However, on the thanks.jsp page, the ${member} EL evaluates to null null. It is getting a member object, but apparently the first and last names are null. I would think the model.addAttribute(member) should put the member object onto the Model under the attribute name "member". I'm not sure why the Member object is coming through null. Can someone advise?
Thanks in advance.
Mike
Controller
Views:
1) Form view:
2) Thanks view: