2011-04-06 174 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

相關問題