Background
The access path, that is, the root path when accessing the Web system in a browser, such as http://localhost:8080/xxxx/index.jsp, where xxxx, or Request.getcontextpath (), gets the value.
When we do system development, in the local workspace may have multiple versions of the same system, such as the above-mentioned XXXX system, there may be xxxx1, Xxxx1_1, xxxx1_2 represents the system of 1.0, 1.1, 1.2 version, The corresponding project name is the system access path by default, however, we may want these projects to have a unified access path XXXX, so when deployed to the server, regardless of which project is deployed, access path is unified.
Method
In the server deployment, such as Tomcat, we only need to modify the corresponding context.xml file, <context path= "" > property corresponding to the access path.
In Eclipse, double-click the Tomcat instance of the server view, as follows
We can see that there are 3 options in the server locations, in which the first option is selected, which is managed by Eclipse's configuration of Tomcat, and the corresponding virtual configuration directory is in the server path column in the picture.
We can go directly to modify the Conf/server.xml file under that path, or click on the modules below to modify the path of each project in the Web modules inside. The effect is ultimately to modify the path content of the context in the Server.xml file.
Modify Web Project Access path in eclipse