Javaweb Path Summary

Source: Internet
Author: User

Reference: http://www.blogjava.net/meil/archive/2006/10/10/73908.html

path: basically divided into relative path and absolute path.

relative path : The path relative to a base directory

Absolute Path : The path relative to the root directory

Server-side Address

Server-side Address "/" is relative to the address of your Web application, this address needs to be resolved on the server side, when the relative address in the JSP and servlet is relative to your Web application, that is, relative to the http://localhost:8080/webapp/

Request.getrequestdispatcher ("Address") in the servlet. ForWord ();

If address is the path to a JSP file,/represents the root directory, which is http://localhost:8080/webapp/

Client Address

The "/" of the relative address in all the HTML pages is relative to the server root directory, i.e. http://localhost:8080/

The Action property address of the form form in HTML contains the "/" that is relative to the server root directory

Example: action= "xx.jsp" or action= "/webapps/xx.jsp"

Brief Analysis : The difference between server root directory and Web application, because the client user requests a variety of different server-side software response, so the "/" in the request is relative to the server root directory, and for the specific Web server software internal address resolution, "/" Indicates that it is relative to the WebApp directory.

Javaweb Path Summary

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.