在Eclipse中将Java Web应用程序部署到glassfish的根上下文? [英] Deploy Java web application to root context for glassfish in eclipse?
问题描述
我可以去 http:// localhost:4848 并完成此操作,但是在进行更改后重新部署时,eclipse会将应用程序部署到/ myapp。
如何做到这一点?
对于仅WAR部署,您必须做这与供应商特定的配置文件。对于Glassfish,您需要在 sun-web.xml
旁边的< context-root>
code> web.xml 文件。
从 http://www.sun.com/bigadmin/sundocs/articles/urlrdn.jsp :
<太阳web应用程序>
< context-root> / mywarname< / context-root>
< / sun-web-app>
I have an application that I only ever intend to deploy to the the root ('/') context using glassfish. Unlike with tomcat in eclipse, there are no application specific settings when I double-click the server in the server browser.
I can go to http://localhost:4848 and accomplish this, but when I redeploy after making a change, eclipse deploys the application to '/myapp'.
How can I do this?
For WAR-only deployments you must do this with a vendor specific configuration file. For Glassfish you need to set the <context-root>
tag inside sun-web.xml
next to the web.xml
file.
From http://www.sun.com/bigadmin/sundocs/articles/urlrdn.jsp:
<sun-web-app>
<context-root>/mywarname</context-root>
</sun-web-app>
这篇关于在Eclipse中将Java Web应用程序部署到glassfish的根上下文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!