Thursday, April 29, 2010

Difference Between URI and URL

URI- Uniform resource Identifier is a superset of URL and URN
e.g.- products/books/detail.html
    It is not a URL because it does not specify how to retrieve the resource.

URL – http://www.xyz.com/products/books/detail.html
is a URL because it specifies how to retrieve the resource

URN- e.g. ISBN:1-9211009-59 is a URN because it uniquely identifies this book.

We can get this to use following code :

System.out.println(“URI : “+ httpRequestObj.getRequestURI());
System.out.println(“URL : “+ httpRequestObj.getRequestURL());

0 comments:

Post a Comment