Dón*_*nal 45 java eclipse tomcat
我通过添加"动态Web模块"方面从Eclipse部署.war应用程序,然后右键单击项目并选择"Run As - > Run on Server".
这很好用,但默认情况下项目部署到/web
Tomcat 的上下文,因为项目名称是web
.有没有办法从Eclipse部署到Tomcat而无需将项目名称更改为ROOT?
Ana*_*rma 82
您需要转到Server View
..双击tomcat,这将打开一个新窗口(带有2个选项卡).选择一个Modules
,您的应用程序将在那里列出(使用上下文路径).您可以从此处将上下文路径从/ web更改为其他任何内容.
或者,您可以打开server.xml查找名为context的标记.在此标记内,您会发现contextroot为/ web ..更改它.
max*_*dim 18
在Eclipse中右键单击您的项目,然后选择Properties-> Web Project Settings.在那里更改上下文名称
或者,您可以在项目内的.settings/org.eclipse.wst.common.component文件中对其进行编辑
小智 7
在项目的Web项目设置中,将上下文根设置为"/". (没有引号)
以防您使用带有mod_proxy的apache2.在我的虚拟主机定义中,我有一个根上下文的Location条目:
<Proxy balancer://ajpCluster>
BalancerMember ajp://localhost:18009 route=s1
BalancerMember ajp://localhost:28009 route=s2
</Proxy>
# A "Location" entry for hosting static content. Would put mod_expire settings
# here
<Location /resources>
ProxyPass ! #Don't proxy this location
ExpiresActive on
ExpiresDefault "access plus 1 seconds"
ExpiresByType application/javascript "access plus 1 months"
</Location>
#...
# This must be the last "Location" if you are overloading others, otherwise
# the others won't load as apache uses the first one listed that matches
<Location />
ProxyPass balancer://ajpCluster stickysession=JSESSIONID
</Location>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
42073 次 |
最近记录: |