How to use HREF to link JSP files in different folders in a Java Web project

Source: Internet
Author: User
Tags java web

    When writing a Java Web project, you need to define a lot of JSP files, if all the unified in the root directory of the webcontent looks like a mess, time has long been unable to find the specific JSP file corresponding function is what, Therefore, it is best to customize the folder in the root directory of webcontent to store JSP files of different function modules.

However, when the JSP file is placed in the WebContent root directory, it is OK to refer to the file name directly when the href reference is needed, and it is not easy to make an error, as follows:

<a href= "find.jsp" > Forgot password </a>

However, when we use a custom folder to put a different JSP file can not be directly referenced, otherwise the following error will appear:

The origin server did not find a current representation for the target resource or was not willing to disclose that one Exi Sts.


So when you put the JSP file in a separate folder, you should pay attention to the method of reference:

<a href= "http://localhost:8080/save_use/Regis/regis.jsp" > Registered account </a><br >
Red is the project name, yellow is the folder name that holds the JSP file, Green is the JSP file

How to use HREF to link JSP files in different folders in a Java Web project

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.