• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Servlet Tunneling

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is servlet tunneling? Why it is used and advantages of using it.Can anyone pl. help me?

thanks
raju
 
author & internet detective
Posts: 42018
916
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raju,
Google comes up with quite a few results on this topic.
 
purushottam srinivas raju
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you jeanne. well I could find sufficient material but a complete code on how srvlet tunneling works could heve been more beneficial to me. I'll will try and in the mean time if you could help me with the same.

thans
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...this is what I use as a client that 'tunnels' into a listening servlet, hope it helps:
java.net.URL url = new java.net.URL(your_target_url_string);

java.net.URLConnection con = url.openConnection();

con.setUseCaches(false);
con.setDoOutput(true);
con.setDoInput(true);

con.setRequestProperty("Content-Type", "text/xml; charset=utf-8");

DataOutputStream out = new DataOutputStream(con.getOutputStream());

out.write(your_string_to_send.getBytes()); // WRITE to the site

out.flush();

BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(con.getInputStream()));
StringBuffer sb = new StringBuffer();
while ((inputLine = bufferedreader.readLine()) != null) {
sb.append(inputLine); // READ from the site
}
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Http client from jakarta commons provides a easier api, if http tunneling is what Larry talks about.
http://jakarta.apache.org/commons/httpclient/
 
Larry Cryderm
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup...the Commons API is full feature HTTP client stuff...didn't know it was out there, Thanks!
 
Something must be done about this. Let's start by reading this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic