This is about the Tomcat JSP virtual directory!

Source: Internet
Author: User

The simplest case is of course to put the. jsp file in the C:\Program files\apache software foundation\tomcat 6.0\webapps\root directory, run Tomcat,

Access http://localhost:8080/HelloWorld.jsp directly in the browser to run the. jsp file

In the actual development and application, it is impossible to install the Tomcat application on the system disk such as C drive.

So, we need to apply the knowledge to set up the virtual directory:

To create a virtual directory to run the JSP file in a browser:
1: Let's say we store the Tomcat Web page in the F:\XXTCHENZS\CHP1 directory, that is, create a folder and store the. jsp file in this directory:

2: Find the 6.0\conf file in C:\Program files\apache software foundation\tomcat server.xml Directory


Open edit with notepad++, add line above <context path= "/jsp 2.0" debug= "0" docbase= "F:\XXTCHENZS" reloadable= "true"/>


Where the property path= "/jsp 2.0" is the execution path of the JSP page, also known as the virtual directory, used to specify the "E:/XXTCHENZS" under the JSP page program when the logical path, the user can set their own.
The Docbase= property "E:\XXTCHENZS" specifies the physical path to the Web directory, which is the real directory.
3: Save changes, rerun Tomcat
4: Access localhost:8080/jsp 2.0/chp1/helloworld.jsp in the browser to run successfully

This is about the Tomcat JSP virtual directory!

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.