Path problems in Servlets and HTML

Source: Internet
Author: User

Path problem:
① relative path and absolute path:

Absolute path: Absolute path is the path with/begins!
Absolute path relative to the current server: if the server resolves, then/represents the absolute path of the current server: http://localhost:8080
Absolute path relative to the current web app: Represents the HTTP://LOCALHOST:8080/project name/

If this is a server-side resolution, the representative is: http://localhost:8080/Project name/
If it is a browser-side resolution, the representative is: http://localhost:8080

Relative path: The path that does not begin with/begins with a relative path, relative to the path of the current Web resource directory!

Common paths for ②:
Path to forward:
> These two absolute paths are resolved by the server, relative to the project's root directory
/HTTP Host Address: Port number/project name/


In the actual development, we use absolute path, do not use relative path! Try not to use hard-coded way in development!
Path in the page:
> These two paths have browser parsing, relative to the root of the server
/HTTP Host Address: Port number/

Path problems in Servlets and HTML

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: 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.