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!