I am using Spring MVC 3, and all I am trying to do is submit a form with an email request and redirect the mail request handler to the controller on some page. But I get the following error when I try to do this:
javax.servlet.ServletException: Circular view path [thanks.htm]: would dispatch back to the current handler URL [/wickedlysmart/thanks.htm] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
The following is the code I'm using:
Request Handler:
@RequestMapping(method=RequestMethod.GET, value="thanks") public ModelAndView thanks() { logger.debug("redirecting.."); return new ModelAndView("thanks"); } @RequestMapping(method = RequestMethod.POST, value="talk") public String processContactForm(HttpServletRequest req) {
Viewing permission in the context of a Spring application:
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="" /> <property name="suffix" value=".htm" /> </bean>
I do not quite understand what is happening here. I see that "redirect .." is logged, and then I get this error. Can someone help me on this?
Thanks.
skip source share