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

查看:371
本文介绍了如何在< 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.

推荐答案

这不能以appserver无关的方式完成。上下文根不是标准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.

  • Glassfish: sun-web.xml;
  • JBoss: jboss-web.xml;
  • Weblogic: weblogic.xml;
  • Tomcat: context.xml;
  • WebSphere: ibm-web-ext.xml.

注意:以上内容适用于部署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天全站免登陆