A Uniform Resource Locator (URL) is an identifier that points to an electronically accessible resource, such as a directory file on a machine in a network, or a document stored in a database.
URLs appear in the format:scheme:scheme_information.
You can represent a scheme as http, ftp, file, or another term that identifies the type of resource and the mechanism by which you can access the resource.
In a World Wide Web browser location or address box, a URL for a file available using HyperText Transfer Protocol starts with http:. An example is http://www.ibm.com. Files available using File Transfer Protocol (FTP) start with ftp:. Files available locally start with file:.
The scheme_information commonly identifies the Internet machine making a resource available, the path to that resource, and the resource name. The scheme_information for HTTP, FTP and File generally starts with two slashes (//), then provides the Internet address separated from the resource path name with one slash (/). For example,
For HTTP and FTP, the path name ends in a slash when the URL points to a directory. In such cases, the server generally returns the default index for the directory.
J2EE applications can use URLs as resources in the same way other J2EE resources, such as JDBC and JavaMail, are used. That is, they can look up references to logically named URL connection factories through the java:comp/env/url subcontext that have been declared in the application deployment descriptor and mapped to installation-specific URL resources.
- W3C Architecture - Naming and Addressing: URIs, URLs
- URL API documentation