如何在 GlassFish 3.0.1 Community Edition 中设置默认战争?

发布于 2024-09-19 19:54:42 字数 276 浏览 4 评论 0原文

现在我有几场战争,每场战争都在浏览器中输入时运行 本地主机:8080/app1 或者 本地主机:8080/app2 当我输入 http://localhost:8080

时,仅显示默认页面。 我想将 app1 设置为默认应用程序,即输入时它必须出现 本地主机:8080 和其他应用程序作为辅助,即它们必须在键入 localhost:8080/app2 时出现。 我该怎么做呢? 提前致谢!

Now I have several wars and each runs when typing in browser
localhost:8080/app1
or
localhost:8080/app2
etc.

When I type http://localhost:8080, appears only the default page.
I want to make app1 as default app, i.e. it must appear when typing
localhost:8080
and others apps as secondary i.e. they must appear when typing localhost:8080/app2.
How can I do it?
Thanks in advance!

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

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

发布评论

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

评论(3

橘虞初梦 2024-09-26 19:54:45

您需要在 WEB-INF/sun-web.xml

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

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

我的猜测是,只要说 / 就会使其成为根应用程序。

(请注意,在 EAR 内部部署时,该机制是不同的)

You need to provide a context-root node in WEB-INF/sun-web.xml.

From http://www.sun.com/bigadmin/sundocs/articles/urlrdn.jsp:

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

My guess would be that saying just / will make it the root application.

(Note that the mechanism is different when deploying inside an EAR)

一生独一 2024-09-26 19:54:44

在管理面板中:配置→虚拟服务器。选择“服务器”(或当前默认值)。填充“默认 Web 模块”选择。节省。

In admin panel: Configuration → VirtualServers. Select “server” (or current default). Populate the 'default web module' select. Save.

咋地 2024-09-26 19:54:44

如果您通过管理控制台手动部署,则上下文根目录将(默认情况下)设置为 .war 的名称。

您可以在“部署 Web 应用程序”屏幕中覆盖此设置。在选择 .war 之后但单击“确定”之前,您需要将“Context Root”输入的值更改为 /

If you are deploying manually through the Admin Console, the context root will (by default) be set to the name of the .war.

You can override this in the "Deploy Web Application" screen. You'll want to change the value of the "Context Root" input to / after selecting your .war but before clicking "OK".

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