I'm just checking out Spring MVC framework, so I'm new to it, pls forgive the basic question. But I'm trying to figure out how the view resolver works.
I created a basic controller method to add a user like this:
@RequestMapping(value = "/add", method = RequestMethod.POST)
public String addUser(@ModelAttribute("user") User user, BindingResult result) {
logger.entry(user, result);
userRepository.save(user);
String returnString="redirect:members/confirmation";
logger.exit(returnString);
return returnString;
}
I want it to redirect to the members/confirmation.jsp page under the WEB-INF/pages folder. It's just a simple JSP that says "thanks for registering". The redirect is so it won't allow form double posting. (This is just a basic test app)
I configured the internalviewresolver in the mvc-dispatcher-servlet.xml configuration file:
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/"/>
<property name="suffix" value=".jsp"/>
<property name="order" value="0"/>
</bean>
But it's not resolving to the confirmation view, and just 404's.
What am I missing here?
Thanks!
Rich