Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Using Java's Net::URL Class To Access URLs

Share this post!
 Vote this!

Java's networking classes enable you to implement applications that communicate across a network/remote connection, but the platform also extends into the realm of the Internet and URLs. Java's URL class makes accessing Web resources as easy as accessing a local file. Let's take a look at how you can tap into the power of the URL class and read and write data over URL connections.


Working With URLs

A URL identifies resources such as files, Web pages, and Web applications that exist on the Web. It consists of a number of syntactic elements. For example, note the following URL:

http://www.go4expert.com:1234/mywebapps/JavaApp

The protocol element is identified as http. The host name is www.go4expert.com. The port number is 1234. The rest of the URL, /mywebapps/JavaApp, identifies the resource to be accessed on the site. The resource, in this case, happens to be a Web application. URLs can also include other elements, such as fragments and query strings.  more...

0 comments:

Post a Comment