Tomcat部署项目的几种方式
1.在MyEclipse中:
菜单栏中选择 Windows -> Preferences -> Myeclipse -> Server - Tomcat ->选择Tomcat版本 ->选定Tomcat路径?->指定JDK ->选定Launch模式为Run mode
?
2.在Tomcat路径\conf\server.xml中指定项目路径:
打开server.xml,在Host标签中添加:
<Context path="/struts2" docBase="D:\coding\struts2\WebRoot" debug="0" reloadable="true" />
?
注意严格区分大小写!
参数说明:
path:表示在浏览器中输入http://localhost:8080/虚拟目录名
docBase:表示你的程序包的物理绝对路径,默认的绝对路径是?%tomcat_home%/webapps?
reloadable :为true,则tomcat会自动检测应用程序的/WEB-INF/lib 和/WEB-INF/classes目录的变化,自动装载新的应用程序,我们可以在不重起tomcat的情况下改变应用程序;为false则不自动加载。