One thing that can be confusing in a JSP-based application is the different type of URIs used in the HTML and JSP elements. The confusion stems from a combination of conflicting terms used to describe URIs in the HTTP, servlet, and JSP specifications, and the fact that some types of URIs are interpreted differently in the HTML and the servlet world.
In HTML, URIs are used as attribute values in elements such as
<form>. JSP elements that use URI attribute
values are the
taglib directives and the
<jsp:include> actions. JSTL and custom
actions can also define attributes that take URI values.
The HTTP/1.1 specification (RFC 2616, with more details in RFC 2396)
defines a URI as a string, following certain rules, that uniquely
identifies a resource of some kind. A URL is just a special kind of
URI that includes a location (such as the server name in an HTTP
URL). An absolute URI is a URI that starts with
the name of a
so called scheme, such as
https, followed by a colon and then the rest of
the resource identifier. An example of an absolute URI for a resource
accessed through the HTTP protocol is:
http is the scheme,
localhost:8080 is the location (a server name and
a port number), and
/ora/ch12/login.jsp is the
The URIs in HTML elements are interpreted by the browser. A browser needs the absolute URI to figure out how to send the requests for the resources ...