What is the difference between relative and absolute url in servlet container. for example if there is an jsp called forum.jsp under webinf folder. when i want dispatch the current request to the jsp from the current jsp file which is under the same webinf folder, is the following correct way
/forum.jsp
relative url means relative to the web-inf folder or to the jsp location.
Absolute URL is :
http://stackoverflow.com/questions/3591899/relative-url-and-absolute-url-differenceand a relative URL is:
/questions/3591899/relative-url-and-absolute-url-differenceAlso, a relative URL can be just:
../questions/3591899/relative-url-and-absolute-url-differencedepending where is the linking page located…Or
./3591899/relative-url-and-absolute-url-differenceif the linking page is located on thequestionsfolderI will suggest to always use Relative URL… and it goes hard, keep trying to use them…
One question, why your JSPs are in the
WEB-INF/folder?You don’t have access to
JSPunder theWEB-INFfolder, if you try to access it the server will throw a404 error.J2EEonly looks for classes and libraries under this folder.