将Java Web应用程序部署到eclipse中glassfish的根上下文?
我有一个应用程序,我只想使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于仅 WAR 部署,您必须使用供应商特定的配置文件来执行此操作。对于 Glassfish,您需要在
web.xml
文件旁边的sun-web.xml
内设置
标记。来自 http://www.sun.com/bigadmin/sundocs/articles/urlrdn。 jsp:
For WAR-only deployments you must do this with a vendor specific configuration file. For Glassfish you need to set the
<context-root>
tag insidesun-web.xml
next to theweb.xml
file.From http://www.sun.com/bigadmin/sundocs/articles/urlrdn.jsp: