Using Servlet, how can I read a webpage via internet into a string object. The webpage could be HTML or JSP. Thanks,
Joined: Jun 27, 2001
You'll be using a URLConnection object, then use a DataInputStream to retrieve the output of the page (if it's a server side script). You could then store it in a String or a File structure. Hope that helps!
Author and all-around good cowpoke
Joined: Mar 22, 2000
Note that if you use a url starting "http://" you automatically get a HttpURLConnection so look in those docs for the methods that let you set request headers etc. Bill