0

I am using a simple html/javascript to post data to a servlet running on SpringSource tc Server, on first click the request is received as a GET rather than a POST, but on subsequent clicks servlet does receive a POST request. why is the request getting converted to a GET before reaching the service method on the servlet. what can be done it resolve it.

I tried opening that html/javascript file in chrome/firefox/IE browsers to see if it makes any difference, but still the same issue.

function formSubmit(){
document.forms['myForm'].action="https://myURL";
document.forms['myForm'].method='post';
    document.forms['myForm'].target='_blank';
    document.forms['myForm'].submit();
}

this is the code that I use on the html page to post the form data to the servlet.
Brian Clozel
  • 56,583
  • 15
  • 167
  • 176
  • 2
    That sounds very unlikely; the request type is set at the **browser**, not the server. Perhaps there's something amiss with your client-side code. – Pointy Apr 03 '12 at 12:50
  • I tried opening that html/javascript file in chrome/firefox/IE browsers to see if it makes any difference, but still the same issue. function formSubmit(){ document.forms['myForm'].action="https://myURL"; document.forms['myForm'].method='post'; document.forms['myForm'].target='_blank'; document.forms['myForm'].submit(); } this is the code that I use on the html page. – Bhaskar Mula Apr 03 '12 at 13:08
  • It's hard to read in the comment; perhaps you could edit the original question. – Pointy Apr 03 '12 at 13:13
  • Exact tc Server runtime version number? It should be an Apache Tomcat version number with a letter on the end. – Mark Thomas Apr 04 '12 at 18:47

0 Answers0