Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Servlets
Apache - HttpConnection
Ramya Iyer
Ranch Hand
Posts: 66
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Using org.apache.commons.httpclient.HttpConnection
I am trying to establish a connection using this class from one
servlet
in one server to another servlet to another server.
I am not sure how I should do it. Is there any snippet of code. I am posting data, but it never reaches my receiving servlet
HttpConnection httpConn = null; HttpClient connection = new HttpClient(); HostConfiguration hostConfig = new HostConfiguration(); HostParams httpParams = new HostParams(); httpParams.setVirtualHost("/ServletServer/TestRequestInputStream"); URI uri = new URI("http://"+ip+":9080/ServletServer/TestRequestInputStream",true); hostConfig.setHost(uri); hostConfig.setParams(httpParams); httpConn = connection.getHttpConnectionManager().getConnection(hostConfig); httpConn.open(); OutputStreamWriter writer = new OutputStreamWriter(httpConn.getRequestOutputStream()); writer.write( "Hi.."); writer.flush(); httpConn.close();
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
axis2 stops making https connections randomly... HELP!
Using Apache http client's MultiThreadedHttpConnectionManager
HTTPS over Apache Commons HttpConnection.
No trusted certificate found : when opeing a ssl connection from behind the proxy.
prob with Jakarta HttpClient & HostConfiguration
More...