title: Not able to redirect with href
body: <p>I have simple spring project and two jsp pages (index.jsp and login.jsp) and there is href in login.jsp to redirect to index.jsp. But i am not able to redirect and getting error HTTP Status 404 the requested resource is not available.
  Please find the attached code: </p>
  
  <p><strong>Homecontroller.java</strong></p>
  
  <pre><code>package n.k.p;
  
  import java.text.DateFormat;    
  import java.util.Date;    
  import java.util.Locale;    
  import org.slf4j.Logger;    
  import org.slf4j.LoggerFactory;    
  import org.springframework.stereotype.Controller;    
  import org.springframework.ui.Model;    
  import org.springframework.web.bind.annotation.RequestMapping;    
  import org.springframework.web.bind.annotation.RequestMethod;
  
  /**
   * Handles requests for the application home page.
   */
  @Controller
  
  public class HomeController {
  
      private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
  
      /**
       * Simply selects the home view to render by returning its name.
       */
      @RequestMapping(value = "/", method = RequestMethod.GET)
      public String home(Locale locale, Model model) {
          logger.info("Welcome home! The client locale is {}.", locale);
  
          Date date = new Date();
          DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);           
          String formattedDate = dateFormat.format(date);         
          model.addAttribute("serverTime", formattedDate );           
          return "login";
      }       
  }
  </code></pre>
  
  <p><strong>login.jsp</strong></p>
  
  
  
  <p></p>
  
  <p></p>
  
  <pre><code>&lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;title&gt;Registration&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;form method="post" action="registration.jsp"&gt;
  
          &lt;table border="1" width="30%" cellpadding="5"&gt;
  
              &lt;thead&gt;
  
                  &lt;tr&gt;
                      &lt;th colspan="2"&gt;Enter Information Here&lt;/th&gt;
                  &lt;/tr&gt;
  
              &lt;/thead&gt;
  
              &lt;tbody&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;First Name&lt;/td&gt;
  
                      &lt;td&gt;&lt;input type="text" name="fname" value="" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Last Name&lt;/td&gt;
  
                      &lt;td&gt;&lt;input type="text" name="lname" value="" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;Email&lt;/td&gt;
  
                      &lt;td&gt;&lt;input type="text" name="email" value="" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;User Name&lt;/td&gt;
                      &lt;td&gt;&lt;input type="text" name="uname" value="" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Password&lt;/td&gt;
                      &lt;td&gt;&lt;input type="password" name="pass" value="" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;input type="submit" value="Submit" /&gt;&lt;/td&gt;
  
                      &lt;td&gt;&lt;input type="reset" value="Reset" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td colspan="2"&gt;Already registered!! &lt;a href="index.jsp"&gt;Login Here&lt;/a&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
  
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>