title: Disable Body Parameters in Query for Struts 1
body: <p>Regular use of the login page in the application uses a <code>DynaValidatorForm</code> that upon clicking 'submit' makes a POST request containing the username and password for the user. It is then validated and dealt with in the associated action class.</p>
  
  <p><strong>Server code:</strong></p>
  
  <pre><code>protected ActionForward performAction(ActionMapping mapping,
          ActionForm form, HttpServletRequest request,
          HttpServletResponse response) throws Exception {    
      DynaValidatorForm dynaForm = (DynaValidatorForm) form;
      //validation here 
      //...
      //
      Login login = new Login();
      PropertyUtils.copyProperties(login, dynaForm);
      //login object is used from here on out
  </code></pre>
  
  <p>However, it is possible to log in by making a GET request with parameters in the URL i.e. <code>www.my-site.com/LoginPage.do?loginName=username&amp;password=password</code></p>
  
  <p><strong>Is there some way to disable Struts from using URL parameters in the form?</strong></p>
  
  <p>My current workaround is to use a filter that checks the query string and redirects if it contains a parameter that should be in the POST body, but I am looking for a more elegant solution. I cannot just disable GET as some other pages that need a similar solution need to be accessible by GET.</p>
  
  <p>Any help is greatly appreciated!</p>