在Eclipse中将Java Web应用程序部署到glassfish的根上下文? [英] Deploy Java web application to root context for glassfish in eclipse?

查看:290
本文介绍了在Eclipse中将Java Web应用程序部署到glassfish的根上下文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,我只打算使用glassfish部署到根('/')上下文。与eclipse中的tomcat不同,当我在服务器浏览器中双击服务器时,没有应用程序特定的设置。



我可以去 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆