I have a UserForm with a nested User class. When I submit the form, the properties are all set to null and don't seem to be binding the nested form values. It is picking up the UserForm properties correctly.
I know this has to be some simple syntax problem, but I've been racking my brain over it for too long and need some help!
Kim
edit.jsp:
UserForm.java:Code:<spring:bind path="userForm.user.firstName"> <input type="text" name="firstName" id="firstName" value="${status.value}" class="text"/> <c:if test="${not empty status.errorMessage}"><span class="fieldError">${status.errorMessage}</span></c:if> </spring:bind>
User.java:Code:public class UserForm { private User user; private boolean newUser; private String repeatedPassword; // getters and setters follow }
Code:public class User implements Serializable{ static final long serialVersionUID = -3202570521013016218L; private String username; private String password; private boolean enabled; private String firstName; private String lastName; // getters and setters follow }
action-servlet.xml:
Code:<bean id="userFormController" class="com.tripshare.web.manage.UserFormController"> <property name="commandName"><value>userForm</value></property> <property name="commandClass"><value>com.example.web.manage.UserForm</value></property> <property name="validator"><ref bean="beanValidator"/></property> <property name="formView"><value>manage/users/edit</value></property> <property name="successView"><value>redirect:/manage/users/index.html</value></property> <property name="sessionForm"><value>true</value></property> <property name="bindOnNewForm"><value>true</value></property> </bean>


Reply With Quote