Adding a user controllerCode:<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/admin/admin_home.html"> AdminController </prop> </props> </property> </bean>
The above mentioned code for redirect doesn't work. I guess it's because there are forward slashes in the redirect parameter. I was able to solve the problem by following code in the controller:Code:<bean id="AdminAddUserController" class="com.fanniemae.disclosure.pcrf.webapp.action.AdminAddUserController"> <property name="formView"> <value>admin_addUser</value> </property> <property name="successView"> <value>redirect:admin/admin_home.html</value> </property> </bean>
Although the problem was solved, I would prefer a solution where the view name is not hard coded in the java file.Code:RedirectView redirectView = new RedirectView("/admin/admin_home.html",true); return new ModelAndView(redirectView);
Any idea on how I could achieve the redirect with the configuration in xml and not in java.


Reply With Quote