title: Error 404 on spring logout
body: <p>I am trying to add login functionality to my app with spring security v.4. Login works fine, but when I am trying to logout an error 404 appears. Spring Security reference says that default logout URL is /logout. My app is deployed under /app URL and I tried following URL's
  localhost:8080/app/logout and localhost:8080/app/json/logout. I found some similar issues on stack but they are about case when CSRF protection is used and I'm not using it. Here is part of my my web.xml file</p>
  
  <pre><code>    &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/json-servlet.xml,
          /WEB-INF/applicationContext.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;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;json&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;json&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/json/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>and my json-servlet.xml where is spring security configuration:</p>
  
  <pre><code>    &lt;context:component-scan base-package="test" /&gt;
  &lt;mvc:annotation-driven /&gt;
  
  &lt;security:http&gt;
      &lt;security:intercept-url pattern="/**" access="hasRole('USER')" /&gt;
      &lt;security:form-login /&gt;
      &lt;security:logout /&gt;
  &lt;/security:http&gt;
  
  &lt;security:authentication-manager&gt;
      &lt;security:authentication-provider&gt;
          &lt;security:user-service&gt;
              &lt;security:user name="test" password="1" authorities="ROLE_USER, ROLE_ADMIN" /&gt;
          &lt;/security:user-service&gt;
      &lt;/security:authentication-provider&gt;
  &lt;/security:authentication-manager&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>