title: Why i am getting Post Not Allowed (405)?
body: <p>I am working with AngularJs, Bootstrap in front end and Java- Spring MVC -Spring security-Hibernate in the backend.
  1. So i created a user
  2. I log in
  3. I fill the profil form and when a save, i have a 405 error.</p>
  
  <p>I don't understand why i am getting a 405 error when i make a post request.</p>
  
  <p>This is my request send from a AngularJS service :</p>
  
  <pre><code>save : function(user) {
              return $http({
                  method: 'POST',
                  url: 'http://localhost:8080/app-web/user/profil/'+user.id+'/create',
  
                  data:user
              })
  </code></pre>
  
  <p>I have <code>http://localhost:8080/app-web/user/profil/49/create failed with status 405</code>
  Here is my Spring Security config file snippet :</p>
  
  <pre><code>&lt;sec:http realm="Protected API" use-expressions="true" auto-config="false"  create-session="stateless" entry-point-ref="unauthorizedEntryPoint" authentication-manager-ref="authenticationManager"&gt;
          &lt;sec:custom-filter ref="authenticationTokenProcessingFilter" position="FORM_LOGIN_FILTER" /&gt;
          &lt;sec:intercept-url pattern="/login" access="permitAll" /&gt;
          &lt;sec:intercept-url pattern="/user/**" access="permitAll" /&gt;
          &lt;sec:intercept-url pattern="/user/profil/**" access="permitAll" /&gt;
          &lt;sec:intercept-url pattern="/user/**" access="permitAll" /&gt;
      &lt;/sec:http&gt;
  </code></pre>
  
  <p>My Controller :</p>
  
  <pre><code>@RequestMapping(value="/user")
  public class UserProfileController {
  
      @RequestMapping(value="/profil/{userid}/create", method= RequestMethod.POST)
      @ResponseBody
      public String createProfil(@RequestBody User user){
          // my logic
          return "OK";
      }
  
  }
  </code></pre>
  
  <p>Spring log :</p>
  
  <pre><code>21:40:40.617 [http-bio-8080-exec-4] DEBUG o.s.s.w.a.i.FilterSecurityInterceptor - Authorization successful
  21:40:40.617 [http-bio-8080-exec-4] DEBUG o.s.s.w.a.i.FilterSecurityInterceptor - RunAsManager did not change Authentication object
  21:40:40.617 [http-bio-8080-exec-4] DEBUG o.s.security.web.FilterChainProxy - /user/profil/49/create reached end of additional filter chain; proceeding with original chain
  21:40:40.617 [http-bio-8080-exec-4] INFO  c.d.j.web.filters.SimpleCORSFilter -  Request ====&gt; 127.0.0.1 ===&gt; java.util.Collections$2@25709a84
  21:40:40.623 [http-bio-8080-exec-4] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'app' processing POST request for [/app-web/user/profil/49/create]
  21:40:40.625 [http-bio-8080-exec-4] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /user/profil/49/create
  21:40:40.627 [http-bio-8080-exec-4] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Did not find handler method for [/user/profil/49/create]
  21:40:40.627 [http-bio-8080-exec-4] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - Matching patterns for request [/user/profil/49/create] are [/**]
  21:40:40.627 [http-bio-8080-exec-4] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - URI Template variables for request [/user/profil/49/create] are {}
  21:40:40.628 [http-bio-8080-exec-4] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - Mapping [/user/profil/49/create] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@663ef60] and 1 interceptor
  21:40:40.629 [http-bio-8080-exec-4] DEBUG o.s.w.s.m.a.ResponseStatusExceptionResolver - Resolving exception from handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@663ef60]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
  21:40:40.630 [http-bio-8080-exec-4] DEBUG o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolving exception from handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@663ef60]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
  21:40:40.630 [http-bio-8080-exec-4] WARN  o.s.web.servlet.PageNotFound - Request method 'POST' not supported
  21:40:40.630 [http-bio-8080-exec-4] DEBUG o.s.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'app': assuming HandlerAdapter completed request handling
  21:40:40.630 [http-bio-8080-exec-4] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request
  21:40:40.630 [http-bio-8080-exec-4] DEBUG o.s.s.w.a.ExceptionTranslationFilter - Chain processed normally
  21:40:40.631 [http-bio-8080-exec-4] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
  </code></pre>