Issue
I am new to net beans and JSP. I created index.jsp
in Web Pages folder and i want to link a text in index.jps
to another JSP called CompanyLogin.jsp
in Web Pages/MainLogins/ComapanyLogins/CompanyLogin.jsp
.
I tried <li><a href="/MainLogins/CompanyLogin/CompanyLogin.jsp">Company</a></li>
but it didn't work. Plese tell me hoe to solve this problem. Thank you for any help
Solution
The slash at the URL's beginning makes it absolute to your host. But usually the first part of the path is the context name. It's safest to use a relative path like
<a href="MainLogins/CompanyLogin/CompanyLogin.jsp">Company</a>
Here relative means relative to the location of index.jsp.
Answered By - vanje
Answer Checked By - Senaida (JavaFixing Volunteer)