如何在 GlassFish 3.0.1 Community Edition 中设置默认战争?
现在我有几场战争,每场战争都在浏览器中输入时运行 本地主机: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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要在 WEB-INF/sun-web.xml。
来自 http://www.sun.com/bigadmin/sundocs/articles/urlrdn .jsp:
我的猜测是,只要说
/
就会使其成为根应用程序。(请注意,在 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:
My guess would be that saying just
/
will make it the root application.(Note that the mechanism is different when deploying inside an EAR)
在管理面板中:配置→虚拟服务器。选择“服务器”(或当前默认值)。填充“默认 Web 模块”选择。节省。
In admin panel: Configuration → VirtualServers. Select “server” (or current default). Populate the 'default web module' select. Save.
如果您通过管理控制台手动部署,则上下文根目录将(默认情况下)设置为 .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".