Need help, this made my head spin. Look at the code
This does not work
However, this doesCode:@Controller public class EmployeeProfileController { @RequestMapping("/expenses_employee") public Object index(HttpSession session) { ModelAndView mv = new ModelAndView("home"); return mv; } }
I used this as resolverCode:@Controller public class EmployeeProfileController { @RequestMapping("/expenses_employee") public Object index(HttpSession session) { return "home"; } }
The weird thing is that 2 of my controllers having EXACTLY the same code, works for both cases.Code:<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <property name="prefix" value="/WEB-INF/jsp/" /> <property name="suffix" value=".jsp" /> <property name="order" value="1" /> </bean>
The problem is that I need to pass variables to the View from the Controller.
Note that this is only a sample code, if the code logic did not make sense just ignore it. I just want to know why it does not work.
I am becoming desperate here
Please I need help.
Thank you for any help you can provide.



Reply With Quote
