2011-04-06 162 views

回答

1

尝试:

<servlet> 
    <servlet-name>app</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <init-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>/WEB-INF/filename.xml</param-value> 
    </init-param> 
    <load-on-startup>2</load-on-startup> 
</servlet> 
+0

是不是应用程序上下文的位置?我们目前的配置有这个设置为一个空值(我不知道为什么这样做了)。我最终做的是配置ContextLoaderListener来加载显式WebApplicationContext文件(其名称取决于环境变量),然后使用contextAttribute参数的值为“org.springframework.web.context.WebApplicationContext.ROOT”来包括(我假设)由ContextLoaderListener加载的所有内容。你能看到这方面的缺点吗? – 2011-04-07 20:52:26

+0

完整示例:[web.xml](https://gist.github.com/908777)。正如你所看到的,它不是应用程序上下文的位置。应用程序上下文位置在顶部定义 – Kakawait 2011-04-07 21:32:14

相关问题