I have a requirement in which my java program will call a jsp page through URLConnection class of java.net package and get the response from the jsp page. The response will include some cookies which will have the session information. Please guide me how I can read the response through httpclient package of apache.
My main aim is to create the session between the simple java program and jsp page.
SCJP 1.4, SCWCD 1.4
Joined: Mar 22, 2005
I don't think you can use HttpCLient to read the response if you use java.net.HttpUrlConnection for the request. Why not use HttpClient for both? In the HttpMethod interface I see methods like getResponseHeaders and getResponseBody, which would seem to do what you're trying to do.