title: This webpage has a redirect loop in spring-security application
body: <p>i have a web application in spring which uses spring security, when i try to excute the application it says </p>
  
  <pre><code>This webpage has a redirect loop
  </code></pre>
  
  <p>this is my <code>security-context.xml</code> after adding this only i get this exception</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;b:beans xmlns="http://www.springframework.org/schema/security"
      xmlns:b="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                          http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"&gt;
  
      &lt;!-- HTTP security configurations --&gt;
      &lt;http use-expressions="true"&gt;
          &lt;form-login login-processing-url="/resources/j_spring_security_check"
              login-page="/login" authentication-failure-url="/login?login_error=t" /&gt;
          &lt;logout logout-url="/resources/j_spring_security_logout" /&gt;
          &lt;intercept-url pattern="/**" access="isAuthenticated()" /&gt;
          &lt;intercept-url pattern="/login*" access="permitAll()" /&gt;
          &lt;intercept-url pattern="/resources/**" access="permitAll()" /&gt;
  
      &lt;/http&gt;
  
      &lt;!-- Configure Authentication mechanism --&gt;
      &lt;authentication-manager alias="authenticationManager"&gt;
          &lt;authentication-provider&gt;
              &lt;user-service&gt;
                  &lt;user name="admin" password="admin" authorities="RIGHT_LIST,RIGHT_CANCEL,RIGHT_CREATE,RIGHT_UPDATE" /&gt;
                  &lt;user name="antony" password="antony" authorities="RIGHT_LIST,RIGHT_CANCEL,RIGHT_CREATE,RIGHT_UPDATE" /&gt;
                  &lt;user name="rod" password="rod" authorities="RIGHT_LIST,RIGHT_CREATE"/&gt;
              &lt;/user-service&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
  
      &lt;global-method-security secured-annotations="enabled" pre-post-annotations="enabled"&gt;
          &lt;expression-handler ref="expHandler"/&gt;
      &lt;/global-method-security&gt;
  
      &lt;b:bean id="expHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler"&gt;
          &lt;b:property name="permissionEvaluator"&gt;
              &lt;b:bean  class="com.anto.springsec.security.CreateContactPermissionEvaluator"/&gt;
          &lt;/b:property&gt;
      &lt;/b:bean&gt;
  
  &lt;/b:beans&gt;
  </code></pre>
  
  <p>i have  one login.jsp and one more createContact.jsp</p>
  
  <p>this is my home controler : </p>
  
  <pre><code>package com.anto.springsec.controllers;
  
  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 = "/login", 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>please help me to resolve this.</p>