title: Why j_spring_security_check 404?
body: <p>I'm trying to implement form based authentication with Spring security. Redirection works fine:
  my main page works correctly and for  <code>http://localhost:8080/master/admin</code> I'm redirected to login page (<code>http://localhost:8080/master/login/</code>): </p>
  
  <pre><code>    &lt;form action="j_spring_security_check" method="POST"&gt;
          &lt;label for="username"&gt;User Name:&lt;/label&gt;
          &lt;input id="username" name="j_username" type="text"/&gt;
          &lt;label for="password"&gt;Password:&lt;/label&gt;
          &lt;input id="password" name="j_password" type="password"/&gt;
          &lt;input type="submit" value="Log In"/&gt;
        &lt;/form&gt;
  
  but when I submit I get 404 on address: `http://localhost:8080/master/login/j_spring_security_check`
  </code></pre>
  
  <p>Here's my configuration web.xml:</p>
  
  <pre><code>    &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/spring/root-context.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;!-- Creates the Spring Container shared by all Servlets and Filters --&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;!-- Processes application requests --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/spring/appServlet/servlet-context.xml&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>And my root-context.xml (i made redirection to google so that I know page exists in context)</p>
  
  <pre><code>&lt;sec:http auto-config="true"&gt;
      &lt;sec:intercept-url pattern="/admin/**" access="ROLE_USER" /&gt;
      &lt;sec:form-login login-page="/login/"
          authentication-failure-url="http://www.google.com" default-target-url="http://www.google.com" /&gt;
      &lt;sec:logout logout-success-url="/logout" /&gt;
  &lt;/sec:http&gt;
  
  &lt;sec:authentication-manager&gt;
      &lt;sec:authentication-provider&gt;
          &lt;sec:user-service&gt;
              &lt;sec:user name="test" password="test" authorities="ROLE_USER, ROLE_ADMIN" /&gt;
              &lt;sec:user name="testuser" password="testuserpassword"
                  authorities="ROLE_USER" /&gt;
          &lt;/sec:user-service&gt;
      &lt;/sec:authentication-provider&gt;
  &lt;/sec:authentication-manager&gt; 
  </code></pre>
  
  <p>I've lost quite a lot of time already, trying different combinations but no luck. Any help is appreciated!</p>