title: Redirect in Spring MVC
body: <p>Why can't I get this to work in my Controller</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST)
  public String onSubmit(
      Model model,
      @ModelAttribute("form") Form form,
      BindingResult result, HttpServletRequest request)
      throws IOException, WriteException, BiffException {
  
      if (result.hasErrors()) {
          return "redirect:index.html";
      }
  
   }
  </code></pre>
  
  <p>I get:</p>
  
  <blockquote>
    <p>javax.servlet.ServletException: Could
    not resolve view with name
    'redirect:index.html' in servlet with
    name 'dispatcher'<br>
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1042)<br>
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)<br>
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)<br>
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)<br>
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)<br>
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)<br>
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)  </p>
  </blockquote>
  
  <p>I've got this to work before. Why not now?</p>