将Java Web应用程序部署到eclipse中glassfish的根上下文?

发布于 2024-10-03 06:40:38 字数 249 浏览 0 评论 0原文

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

我可以转到 http://localhost:4848 并完成此操作,但是当我在进行更改后重新部署时,Eclipse 会部署应用程序到“/myapp”。

我该怎么做?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

各自安好 2024-10-10 06:40:38

对于仅 WAR 部署,您必须使用供应商特定的配置文件来执行此操作。对于 Glassfish,您需要在 web.xml 文件旁边的 sun-web.xml 内设置 标记。

来自 http://www.sun.com/bigadmin/sundocs/articles/urlrdn。 jsp

<sun-web-app>
  <context-root>/mywarname</context-root>
</sun-web-app>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文