title: How to disable GET requests to JSP page?
body: <p>I am fixing some old defects and as part of one defect, I need to make sure that some requests are being only POST to the JSP page instead of a GET request. The application have a form which submits data to another JSP page (I know its wrong and against MVC but too late to fix it), since it is a JSP page, so we can POST the request or else we can GET the request. In case of a malicious user, can read the form and send the request as a GET from the browser like <code>http://host:80/somejsp.jsp?param=value&amp;param=value</code> etc. In that case, it becomes a violation. I need to make sure that such GET requests are not processed. One way to do is to perform the below steps in the jsp page -</p>
  
  <pre><code>if (request.getMethod().equals("GET")) {
     // reroute the user as it is not a valid req
  }
  </code></pre>
  
  <p>Is there any other way to do it?</p>