简体   繁体   中英

JSP link to Another JSP file in a different Folder

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM