Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dispaly content of a url using httpurlconnection
02-19-2010, 08:08 PM
Post: #1
dispaly content of a url using httpurlconnection
I want to display the content of a url that I specified in my servlet using httpurlconnection class. I tried something like the following, but I always get a blank page, am I missing anything?

URL url = new URL("http://www.msn.com");
HttpURLConnection urlc = (HttpURLConnection)url.openConnection();
urlc.setRequestMethod("GET");
urlc.connect();

I know I can use something like response.redirect, but I must use HttpURLConnection.

Thanks in advance for your help.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:

Contact UsDeveloper SolutionReturn to TopReturn to ContentLite (Archive) ModeRSS Syndication