0

I'm hitting the same origin policy with Ajax. However I need to make a form post to another server.

So here is the question: How do I make a call to my JSP and have that JSP auto submit a form to another server?

I have tried using the AJAX call to my JSP page but now i cannot get the page to actually submit the form, when it returns back the httpRequest i end up with just the plain HTML from that page.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
user677275
  • 77
  • 1
  • 3
  • 15

1 Answers1

0

cURL equivalent in JAVA

Set your variables and connection via HttpURLConnection then send with Post headers to your remote.

The response of that can be forwarded as a response to JavaScript from XHR since its on the same domain.

Community
  • 1
  • 1
Matt Lo
  • 5,442
  • 1
  • 21
  • 21
  • quite genius i dont know why didnt this occur to me sooner. I have used httpUrlConnection in the past but to query a webservice. Should have known better. :-) Thank you very much for your response. – user677275 Jan 23 '12 at 11:55