27.2 Manipulating URLs

The Internet offers many protocols. The HyperText Transfer Protocol (HTTP), which forms the basis of the web, uses URIs (Uniform Resource Identifiers) to identify data on the Internet. URIs that specify the locations of websites and web pages are called URLs (Uniform Resource Locators). Common URLs refer to files or directories and can reference objects that perform complex tasks, such as database lookups and Internet searches. If you know the URL of a publicly available web page, you can access it through HTTP.

Java makes it easy to manipulate URLs. When you use a URL that refers to the exact location of a resource (e.g., a web page) as an argument to the showDocument method of interface AppletContext, the browser in ...

Get Java How to Program (early objects), 9/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.