JSP pages not in the same folder are accessed to each other.

Source: Internet
Author: User

Question:

Can JSP pages in different folders be accessed to each other?

First:

For example:
There is a login page A. jsp, which is placed in the B folder, and B. jsp page in the B.
From a. jsp ----> B. jsp, you can: <a href = "B/B. jsp"> </a>;

Second:

For example:
There is a login page A. jsp, which is placed in the B folder, and B. jsp page in the B.

From B. jsp ----> A. jsp?

Solution: <a href = "../index. jsp"> </a>

Third:

From folder A. jsp to folder B. jsp

Solution:

<A href = "../B. jsp"> </a>

The reason is that when a. jsp accesses B. jsp, the default access path is ../A/.. B. jsp.

That is, when a. jsp accesses JSP under other folders, the default access path is...//..
This is based on his own path, because the AB two folders are tied together, if

<A href = "B/B. jsp"> </a> the Error Path is ../a/B/B. jsp.

Suggestion: Compare the three paths!

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.