Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.war文件中包含web.xml的Spring启动应用程序_Spring - Fatal编程技术网

.war文件中包含web.xml的Spring启动应用程序

.war文件中包含web.xml的Spring启动应用程序,spring,Spring,我有一个spring启动应用程序,在tomcat embedded中运行良好。但是当我将.war文件作为最终输出时,我没有WEB-INF/WEB.xml文件。要一次性部署它,我需要最终output.war中的web.xml。如何在内置中获得它?如果将其部署在与Servlet 3.0兼容的容器中,则不需要web.xml。您也可以从Spring使用WebApplicationInitializer机制(例如检查SpringBootServletilizer)。但是如果我没有继承Spring启动示例父

我有一个spring启动应用程序,在tomcat embedded中运行良好。但是当我将.war文件作为最终输出时,我没有WEB-INF/WEB.xml文件。要一次性部署它,我需要最终output.war中的web.xml。如何在内置中获得它?

如果将其部署在与Servlet 3.0兼容的容器中,则不需要web.xml。您也可以从Spring使用WebApplicationInitializer机制(例如检查SpringBootServletilizer)。

但是如果我没有继承Spring启动示例父级(在示例中),我就无法正确创建war