春3.1.4 的Java 1.7春季調度servlet的靜態HTML文件,默認路徑
我有配置的所有URL的DispatcherServlet的web應用程序。他們中的大多數將有映射。有些情況下,當我訪問使用http://host:port/myapp/index.html
正確顯示網頁目錄下的index.html的內容的應用程序的一些靜態文件。我用下面的代碼片斷中的myapp-servlet.xml中
<mvc:default-servlet-handler/>
我預期當URL http://host:port/myapp
被訪問默認的index.html將呈現,因爲我有我的web.xml中有以下實現這一目標
<servlet-mapping>
<servlet-name>myapp</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
然而,這似乎並沒有這樣的情況,即,除非在URL中的DispatcherServlet不能妥善解決它指定的index.html。誰能告訴我如何可以做到這一點?服務器日誌告訴我下面的
o.a.c.c.C.[.[.[/myapp] - servletPath=null, pathInfo=null, queryString=null, name=default
o.a.c.c.C.[.[.[/myapp] - Named Dispatcher Forward
o.a.c.c.C.[.[.[/myapp] - Disabling the response for futher output
o.s.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'myapp': assuming HandlerAdapter completed request handling
o.s.web.servlet.DispatcherServlet - Successfully completed request