對於web項目,訪問路徑是否包含項目名稱等修改訪問路徑的配置方式:
我所使用的是maven進行管理,只需要在pom.xml中進行如下配置
<!-- jetty插件 jetty:run-->
<build>
<finalName>AutotestPlatform</finalName>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.7.v20150116</version>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<webApp>
<contextPath>/AutotestPlatform/</contextPath>
</webApp>
<httpConnector>
<port>80</port>
</httpConnector>
<reload>automatic</reload>
</configuration>
</plugin>
</plugins>
</build>
主要修改配置:
<webAppConfig>
<contextPath>/</contextPath>
</webAppConfig>
這樣,訪問是localhost/ 上面是localhost/AutotestPlatform/