The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

reply

Posted by Vasu on December 21, 2001 at 2:37 AM

> I want to write a programmes in Java which can connect a website and return data from the website( like its opening page, and its source eg. HTML code or Java script code of that site )...
> i can use:
> java.net.url myUrl = "www.mySite.com";
> But how to connect this site if i am using proxy setting.And again how to show the content of this site ?
> Thanks in advance
> Regards
> Aminur

hai,
add the following code to your code

Properties props= new Properties(System.getProperties());
props.put("http.proxySet", "true");
props.put("http.proxyHost", <>);
props.put("http.proxyPort", << proxy port>>);
System.setProperties(newprops);
...

and about displaying html content .. use JEditorPane




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us