Tiya Khambadkone wrote:Isn't using relative path better than absolute ?
The path starting with "/WEB-INF'" is relative. An absolute path starts with the protocol (e.g. http: or https:)
But there are a number of types of relative paths, each of which may be required or preferred in different situations:
server-relative path, starts with the context path. Preferred for URLs initiated from the browser (e.g. images, script files, stylesheets, form actions, and so on).
context-relative path, starts with "/" and is relative to the context base. The path starting with "/WEB-INF" is a good example. Preferred for paths used on the server for resources within the same web app (includes, forwards, etc).
page-relative path, relative to the current URL path. Anything that starts with "." or ".." or a file or folder name relative to the current path. These are fragile because they are relative to something that may change (current path) and should not be used in Java web applications. (The one exception is paths within stylesheets which cannot be easily prefixed programmatically with the context path.)
The path starting with ".." is a page-relative path and should not be used.