app
|
|----JSP
| |---Check.jsp
| |---Home.jsp
|
|----HTML
|---Contact.html
|---Downloads.html
Let this be the directory structure of you web application "app" with two subdirectories
JSP and HTML containing Check.jsp & Home.jsp and Contact.html & Downloads.html.
The ABSOLUTE PATH of Check.jsp would be
"/JSP/Check.jsp"and that of Contact.html is
"/HTML/Contact.html". The absolute path always start with a slash "/". This is the path of your resource from the root directory of your web application.
Proceeding now, lets say you are accessing Check.jsp and from there you want to forward to Home.jsp using Request Dispatcher then the relative path would be simply
"Home.jsp" or
"./Home.jsp"(since, you are already accessing in the JSP directory). If, you want to forward to Downloads.html then the relative path would be
"../HTML/Downloads.html".
Here "." means the current directory, and ".." the parent directory.
NOTE: The relative path never starts with a slash "/". It is always relative to the current directory your resource lies(i.e. the one from where you forward, include or redirect).
Hope you get it.