title: Getting Error as org.springframework.web.servlet.PageNotFound handleHttpRequestMethodNotSupported
body: <p>I have followed the link <a href="http://o7planning.org/web/fe/default/en/document/29799/simple-login-web-application-using-spring-mvc-spring-security-and-spring-jdbc" rel="nofollow">Example Link </a> to create the Login Application. I have not used maven for the project.</p>
  
  <p>When iam running the application <a href="http://localhost:9889/SpringMVCDemo/login" rel="nofollow">http://localhost:9889/SpringMVCDemo/login</a></p>
  
  <p>getting redirected to below link </p>
  
  <p><a href="http://localhost:9889/SpringMVCDemo/j_spring_security_check" rel="nofollow">http://localhost:9889/SpringMVCDemo/j_spring_security_check</a></p>
  
  <p>iam getting the following error. </p>
  
  <p>in the console iam getting below error message</p>
  
  <pre><code>INFO: Server startup in 18487 ms
  Aug 10, 2015 4:07:54 PM org.springframework.web.servlet.PageNotFound handleHttpRequestMethodNotSupported
  WARNING: Request method 'POST' not supported
  </code></pre>
  
  <p>In Browser</p>
  
  <pre><code>HTTP Status 405 - Request method 'POST' not supported
  type Status report
  
  message Request method 'POST' not supported
  
  description The specified HTTP method is not allowed for the requested resource.
  </code></pre>
  
  <hr>
  
  <p>Apache Tomcat/8.0.24</p>
  
  <p><strong>EDIT:</strong>
  Login.jsp</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;Login&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
   &lt;h1&gt;Login&lt;/h1&gt;
   &lt;form name='f' action="j_spring_security_check" method='POST' &gt;
      &lt;table&gt;
         &lt;tr&gt;
            &lt;td&gt;User:&lt;/td&gt;
            &lt;td&gt;&lt;input type='text' name='username' value=''&gt;&lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr&gt;
            &lt;td&gt;Password:&lt;/td&gt;
            &lt;td&gt;&lt;input type='password' name='password' /&gt;&lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr&gt;
            &lt;td&gt;&lt;input name="submit" type="submit" value="submit" /&gt;&lt;/td&gt;
         &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Spring-Security</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans:beans xmlns="http://www.springframework.org/schema/security"
  xmlns:beans="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.xsd
  http://www.springframework.org/schema/security
  http://www.springframework.org/schema/security/spring-security.xsd"&gt;
  
  
     &lt;http use-expressions="true"&gt;
         &lt;intercept-url pattern="/" access="isAnonymous()" /&gt;
         &lt;intercept-url pattern="/welcome" access="isAnonymous()" /&gt;
         &lt;intercept-url pattern="/login" access="isAnonymous()" /&gt;
         &lt;intercept-url pattern="/logout" access="isAnonymous()" /&gt;
  
  
         &lt;intercept-url pattern="/userInfo"
             access="hasAnyRole('ROLE_USER', 'ROLE_ADMIN')" /&gt;
         &lt;intercept-url pattern="/admin" access="hasRole('ROLE_ADMIN')" /&gt;
         &lt;intercept-url pattern="/other/**" access="isAuthenticated()" /&gt;
  
         &lt;access-denied-handler error-page="/403" /&gt;
  
         &lt;form-login login-page='/login' login-processing-url="/j_spring_security_check"
             default-target-url="/userInfo" always-use-default-target="false"
             authentication-failure-url="/login?error=true" username-parameter="username"
             password-parameter="password" /&gt;
  
         &lt;logout logout-url="/logout" logout-success-url="/logoutSuccessful"
             delete-cookies="JSESSIONID" invalidate-session="true" /&gt;
  
     &lt;/http&gt;
  
     &lt;authentication-manager&gt;
         &lt;authentication-provider&gt;
             &lt;user-service&gt;
                 &lt;user name="user1" password="12345" authorities="ROLE_USER" /&gt;
                 &lt;user name="admin1" password="12345" authorities="ROLE_USER, ROLE_ADMIN" /&gt;
             &lt;/user-service&gt;
         &lt;/authentication-provider&gt;
  
  
  
         &lt;!-- authentication from database --&gt;
         &lt;authentication-provider&gt;
             &lt;jdbc-user-service data-source-ref="myDataSource"
                 users-by-username-query="select username,password, enabled from users where username=?"
                 authorities-by-username-query="select username, role from users where username=?" /&gt;
         &lt;/authentication-provider&gt;
  
     &lt;/authentication-manager&gt;
  
  &lt;/beans:beans&gt;
  </code></pre>
  
  <p>I have read some answers in stack overflow but dint find the solution.</p>
  
  <p>Can some one please help me.</p>