I have a Servlet in a WebSphere Web Container. I need to submit a page to another application in another Web Container running in WebLogic.
What I've done thus far is use the doGet() in my Servlet to retrieve some needed values from my login page out of the request object. Then I opened a URLConnection to the other application and read in a form from their site.
Now I have the entire HTML form stored in my Servlet as a String,
from the "<!DOCTYPE HTML PUBLIC "-//W3C//Dtd HTML 4.0 Transitional//EN"><html>"
to the </html>.
Their form does a POST and the ACTION passes in something like
FORM NAME="LoginForm" METHOD="POST" ACTION="VP;jsessionid=2CqL
The jsessionid was established with I read the page from the URLConnection. The form is pretty simple,
a couple of input text fields and serveral hidden field.
So I need to submit this form. It performs a login on the other application.
I tried a resp.sendRedirect( "http://server:7002/VP;jsessionid=2Dle1E45iqBrIziJcPWtE3ChsfzYphQiLg3QWePuHI5zUtqHCPCF!-1627733873!152169157!7002!7022
But this displays an error on their page. Don't this this is really submitting that form String in my Servlet. I don't believe forwards will work because I think you need to forward to a URL in the same Web Container. Same goes for includes, they more or less get bounced back to my doGet().
I think I can open another URLConnection or Socket back to the server, but not sure how to POST this and keep it from coming back to my doGet().
Any help would be greatly, greatly appreciated.