Hi, this is my first post, and I'm sorry if this is a noob question. My problem is trying to bind a bean in a jsp page. These are the details:
1º The user has a login page (let's call it adminLogin.jsp). When he logs in, then I do
The success view of that form is admin, which in turn is resolved to admin.jsp (this works)Code:return new ModelAndView((getSuccessView()));
2º In admin.jsp I have:
The trouble is:Code:<spring:bind path="adminHomeFormBean.selected"> <select name="usersCombo"> <c:forEach var="person" items="${adminHomeFormBean.people}"> <option value="<c:out value="${person.key}"/>" <c:if test="${person.key == status.value}"> selected="selected"</c:if> > <c:out value="${person.key}"/> </option> </c:forEach> </select> </spring:bind>
* It works if I type directly on the address bar the URL (http://localhost:8080/AppName/admin.htm)
* When reaching that page from the controller of the login controller it doesn't work. I've found that the controller of this admin page is never used to make the command object in this second scene.
Config and others:
Code:<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/adminLogin.htm">webAdminLoginFormControl</prop> <prop key="/addUser.htm">webAddUserFormControl</prop> <prop key="/admin.htm">webAdminHomeFormControl</prop> </props> </property> </bean>
Code:<bean id="webAdminLoginFormControl" class="web.control.AdminLoginFormControl"> <property name="sessionForm"><value>true</value></property> <property name="commandName"><value>adminLoginFormBean</value></property> <property name="commandClass"><value>forms.AdminLoginFormBean</value></property> <property name="validator"><ref bean="adminLoginValidator"/></property> <property name="formView"><value>adminLogin</value></property> <property name="successView"><value>admin</value></property> <property name="adminLoginFormControl"><ref bean="adminLoginFormControl" /></property> </bean> <bean id="webAdminHomeFormControl" class="web.control.AdminHomeFormControl"> <property name="methodNameResolver"><ref bean="actionResolver"/></property> <property name="sessionForm"><value>true</value></property> <property name="commandName"><value>adminHomeFormBean</value></property> <property name="commandClass"><value>forms.AdminHomeFormBean</value></property> <property name="validator"><ref bean="adminHomeValidator"/></property> <property name="formView"><value>admin</value></property> <property name="successView"><value>adminSuccess</value></property> <property name="personDAO"><ref bean="personDAO"/></property> <property name="bindOnNewForm"><value>true</value></property> </bean>
The controller class extends the AbstractMultiActionFormController from
http://forum.springframework.org/sho...FormController
(implemented in the post with subject java 1.4 compatibility)
I don't know how to make spring use the formBackingObject I've implemented in the controller when reaching the page through the login controller
Regards


Reply With Quote
