This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes apache commons-httpclient Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "apache commons-httpclient" Watch "apache commons-httpclient" New topic

apache commons-httpclient

kapil munjal
Ranch Hand

Joined: May 11, 2004
Posts: 298

I have a requirement in which my java program will call a jsp page through URLConnection class of 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.


Kapil Munjal
SCJP 1.4, SCWCD 1.4
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
I don't think you can use HttpCLient to read the response if you use 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.
I agree. Here's the link:
subject: apache commons-httpclient
It's not a secret anymore!