title: Redirect to a JSP file from controller action in Spring MVC
body: <p>In my spring mvc application, I have the following login form:</p>
  
  <pre><code>&lt;!--LOGIN FORM--&gt;
  &lt;form name="login-form" class="login-form" action="usuario_login.html" method="post"&gt;
  
      &lt;!--HEADER--&gt;
      &lt;div class="header"&gt;
      &lt;!--TITLE--&gt;&lt;h1&gt;Login Form&lt;/h1&gt;&lt;!--END TITLE--&gt;
      &lt;!--DESCRIPTION--&gt;&lt;span&gt;Fill out the form below to login to my super awesome imaginary control panel.&lt;/span&gt;&lt;!--END DESCRIPTION--&gt;
      &lt;/div&gt;
      &lt;!--END HEADER--&gt;
  
      &lt;!--CONTENT--&gt;
      &lt;div class="content"&gt;
      &lt;!--USERNAME--&gt;&lt;input name="username" type="text" class="input username" value="Username" onfocus="this.value=''" /&gt;&lt;!--END USERNAME--&gt;
      &lt;!--PASSWORD--&gt;&lt;input name="password" type="password" class="input password" value="Password" onfocus="this.value=''" /&gt;&lt;!--END PASSWORD--&gt;
      &lt;/div&gt;
      &lt;!--END CONTENT--&gt;
  
      &lt;!--FOOTER--&gt;
      &lt;div class="footer"&gt;
      &lt;!--LOGIN BUTTON--&gt;&lt;input type="submit" name="submit" value="Login" class="button" /&gt;&lt;!--END LOGIN BUTTON--&gt;
      &lt;/div&gt;
      &lt;!--END FOOTER--&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>the page usuario_login.html is configured in the DispatcherServlet in this way:</p>
  
  <pre><code>@RequestMapping(value="/usuario_login", method=RequestMethod.POST)
      public ModelAndView usuario_login(@RequestParam("username") String username, @RequestParam("password") String password) {
          UsuarioDAO usuario = new UsuarioDAO(username, password);
          if(usuario.getUsuario() == null) {
              String message = "oops! n&amp;atilde;o foi possivel efetuar o login. Confira seu login e senha e tente novamente.";
              return new ModelAndView("","message",message);
          }
          else {
              this.sessao = new Sessao(usuario.getUsuario());
              return new ModelAndView("usuario_start","usuario",usuario.getUsuario());
          }
      }
  </code></pre>
  
  <p>My question is: In case of login fail (the condition <strong>usuario.getUsuario() == null</strong> how i can redirect to my file index.jsp, where the login form is placed? I want send a message explaining the situation, to be displayed in this page, too.</p>