你如何在你的 <web-app> 中指定根上下文?web.xml 中的标签? [英] How do you specify the root context in your <web-app> tags in web.xml?

查看:22
本文介绍了你如何在你的 <web-app> 中指定根上下文?web.xml 中的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 WAR 文件中指定我的 Java Web 应用程序的根上下文.如何在 web.xml 文件中使用有效的 web-app XML 执行此操作?

I would like to specify the root context of my Java web application in my WAR file. How can I do this using valid web-app XML in a web.xml file?

哦,是的,我想以一种与应用服务器无关的方式来做这件事.

Oh, yes I would like to do this in an application server agnostic way.

推荐答案

这不能以与应用程序服务器无关的方式完成.上下文根不是标准 web.xml 文件的一部分.它要么在您部署应用程序时指定,要么在应用程序服务器特定描述符中指定.

This can't be done in an appserver agnostic way. Context root isn't part of the standard web.xml file. It's either specified when you deploy the app or in an appserver specific descriptor.

注意: 以上适用于部署 WAR 文件.EAR 文件是另一回事,上下文可以指定为 application.xml 部署描述符.

Note: the above applies to deploying WAR files. EAR files are a different story and the context can be specified as part of the application.xml deployment descriptor.

这篇关于你如何在你的 <web-app> 中指定根上下文?web.xml 中的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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