Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/397.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.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
Java jboss spring applicationContext在web.xml中启动时加载_Java_Spring_Wildfly_Applicationcontext - Fatal编程技术网

Java jboss spring applicationContext在web.xml中启动时加载

Java jboss spring applicationContext在web.xml中启动时加载,java,spring,wildfly,applicationcontext,Java,Spring,Wildfly,Applicationcontext,我正在使用wildfly 8.2.0。我想在开始时加载spring-config.xml 然而,这是不成功的。我做错了什么 这是我的web.xml <?xml version="1.0" encoding="UTF-8"?> http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version=“3.1”> BQP 上下文配置位置 src/main/resources/spring config*.xml org.springf

我正在使用wildfly 8.2.0。我想在开始时加载spring-config.xml 然而,这是不成功的。我做错了什么

这是我的web.xml

<?xml version="1.0" encoding="UTF-8"?>

http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version=“3.1”>

BQP
上下文配置位置
src/main/resources/spring config*.xml
org.springframework.web.context.ContextLoaderListener
放松
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
放松
/休息/*
javax.ws.rs.Application
com.bionic.rest.ApplicationConfiguration
resteasy.servlet.mapping.prefix
/休息
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap

对于spring MVC,您可以从web.xml加载配置xml,如下所示 它将在应用程序启动时加载

<!-- Spring MVC     -->
    <servlet>
        <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/spring/app-config.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

SpringMVC调度程序Servlet
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
/WEB-INF/spring/app-config.xml
1.

我使用org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher,使用rg.springframework.web.servlet.DispatcherServlet会不会有问题?
<!-- Spring MVC     -->
    <servlet>
        <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/spring/app-config.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>