一、环境:
- tomcat8;
- jdk1.8;
- windows
二、操作步骤:
- 修改server.xml:(E:\apach-tomcat\apache-tomcat-8.5.24\conf\server.xml)
<Context path="/test1" reloadable="true" docBase="E:\apach-tomcat\apache-tomcat-8.5.24\webapps\test1"/>
<Context path="/test2" reloadable="true" docBase="E:\apach-tomcat\apache-tomcat-8.5.24\webapps\test2"/>
path是浏览器访问url后面跟随的目录,docBase是应用的路径。
- 解压应用到webapp目录:
- 启动tomcat:
三、部署过程遇到的问题:
java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [] instead of [D:/tomcat-5.0.19/webapps/its/] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>webapp.root1</param-value>
</context-param>
注:webAppRootKey的解释,粗暴的理解就是每个应用的唯一key,在tomcat内webAppRootKey应该是独一无二!