title: Redirect does not working properly using spring mvc
body: <p>Redirection does not work properly. I could not understand the problem because I very new to spring.</p>
  
  <p>Here is my controller when I submit my form then ("schoolform") submitForm controller called and it redirect to another controller to ('form') form controller but it goes to ("login") login controller. I don't know why ?
  I want to redirect schoolform to form controller.   </p>
  
  <pre><code>@RequestMapping(value = "/schoolform", method = RequestMethod.POST)
      public String submitForm(@ModelAttribute("school")School school,Model model,HttpServletRequest request,HttpServletResponse resp) {
          Authentication auth = SecurityContextHolder.getContext().getAuthentication();
          schoolService.update(school);
              System.out.println("Form submitted finaly, No further changes can be made.");
          return "redirect:/form.html";
      }
  
  
  @RequestMapping(value = "/form", method = RequestMethod.GET)
      public String form(Model model,HttpServletRequest request) {
          HttpSession session = request.getSession(true);
          Authentication auth = SecurityContextHolder.getContext().getAuthentication();
          String name = auth.getName(); // get logged in username
          System.out.println(name+"--------form page-----");
  
       }
  
  @RequestMapping(value = "/login", method = RequestMethod.GET)
      public ModelAndView login(
              @RequestParam(value = "error", required = false) String error,
              @RequestParam(value = "logout", required = false) String logout) {
          logger.info("------------------LoginController ---------------");
          System.out.println("LoginController ");
          ModelAndView model = new ModelAndView();
          if (error != null) {
              model.addObject("error", "Invalid username and password!");
          }
  
          if (logout != null) {
              model.addObject("msg", "You've been logged out successfully.");
  
          }
          model.setViewName("login");
          return model;
  
      }
  </code></pre>