[tomcat]tomcat 只输ip或localhost就可以直接访问项目的步骤

原文地址:http://yubolg.iteye.com/blog/1645805

例1:.  配置默认的项目名称。 

   在tomcat/conf/server.xml中 
   在<Host name="localhost"  appBase="webapps" 
            unpackWARs="true" autoDeploy="true" 
            xmlValidation="false" xmlNamespaceAware="false"> 
  后,在</host>之前加上<Context path="" docBase="wws" debug="5" reloadable="true" /> 

wws是项目名称。 


------------------------------------------------------

例2:

在eclipse中用ant构建后,tomcat的server.xml可以直接指向构建后的web项目。

<Service name="open">
		<Connector URIEncoding="utf-8" acceptCount="100" connectionTimeout="120000" debug="0" disableUploadTimeout="true" enableLookups="false" maxSpareThreads="75" maxThreads="50000" minSpareThreads="25" port="8080" protocol="HTTP/1.1" redirectPort="8443" />
		<Engine defaultHost="open.play.cn" name="open">
			<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase" />
			<Host appBase="E:\eclipse_workspace_test\egame.server.open\target\WebRoot" autoDeploy="true" name="open.play.cn" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
				<Context allowLinking="true" cookies="true" debug="1" docBase="" path="/" reloadable="false">
					<WatchedResource>WEB-INF/web.xml</WatchedResource>
				</Context>
			</Host>
		</Engine>
	</Service>


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值