`

Spring参考手册 mvc:default-servlet-handler

 
阅读更多
Spring参考手册 mvc:default-servlet-handler

This tag allows for mapping the DispatcherServlet to "/" (thus overriding the mapping of the container's default Servlet), while still allowing static resource requests to be handled by the container's default Servlet.
这个标签吧DispatcherServlet 映射到"/"(从而覆盖容器的默认servlet的映射),也允许容器默认的servlet处理静态资源的请求。
//我感觉这句的意思就是:DispatcherServlet把找不到的请求映射到默认的servlet,从而实现处理静态资源的请求。不知理解的对不对?

It configures a DefaultServletHttpRequestHandler with a URL mapping (given a lowest precedence order) of "/**".
This handler will forward all requests to the default Servlet.
配置了DefaultServletHttpRequestHandler最后来处理"/**"的请求。
这个处理器会把所有的请求跳转到容器默认servlet。

To enable this feature using the default setup, simply include the tag in the form:
标签的默认设置就可以实现这个功能:
<mvc:default-servlet-handler/>
The caveat to overriding the "/" Servlet mapping is that the RequestDispatcher for the default Servlet must be retrieved by name rather than by path.
覆盖"/"映射会导致默认servlet的RequestDispatcher必须用名字取回而不是路径。(不知道什么意思,是不是跟下一句有关联呐,使用名字找默认servlet)

The DefaultServletHttpRequestHandler will attempt to auto-detect the default Servlet for the container at startup time, using a list of known names for most of the major Servlet containers (including Tomcat, Jetty, Glassfish, JBoss, Resin, WebLogic, and WebSphere).
DefaultServletHttpRequestHandler在容器启动是会使用主流web容器默认servlet的名称列表自动查找容器的默认servlet,包括Tomcat, Jetty, Glassfish, JBoss, Resin, WebLogic, and WebSphere。

If the default Servlet has been custom configured with a different name, or if a different Servlet container is being used where the default Servlet name is unknown, then the default Servlet's name must be explicitly provided as in the following example:
如果为默认servlet配置了新的名称,或者这个容器servlet名字不在spring列表中是,必须显式配置默认servlet的名字,如下:
<mvc:default-servlet-handler default-servlet-name="myCustomDefaultServlet"/>

分享到:
评论

相关推荐

    netty-handler-4.1.65.Final-API文档-中英对照版.zip

    赠送jar包:netty-handler-4.1.65.Final.jar; 赠送原API文档:netty-handler-4.1.65.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.65.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.65....

    netty-handler-4.1.68.Final-API文档-中文版.zip

    赠送jar包:netty-handler-4.1.68.Final.jar; 赠送原API文档:netty-handler-4.1.68.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.68.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.68....

    netty-handler-4.1.24.Final-API文档-中文版.zip

    赠送jar包:netty-handler-4.1.24.Final.jar; 赠送原API文档:netty-handler-4.1.24.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.24.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.24....

    netty-handler-4.1.73.Final-API文档-中文版.zip

    赠送jar包:netty-handler-4.1.73.Final.jar; 赠送原API文档:netty-handler-4.1.73.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.73.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.73....

    netty-handler-proxy-4.1.73.Final-API文档-中文版 (1).zip

    赠送jar包:netty-handler-proxy-4.1.73.Final.jar; 赠送原API文档:netty-handler-proxy-4.1.73.Final-javadoc.jar; 赠送源代码:netty-handler-proxy-4.1.73.Final-sources.jar; 赠送Maven依赖信息文件:netty-...

    netty-handler-proxy-4.1.68.Final-API文档-中文版.zip

    赠送jar包:netty-handler-proxy-4.1.68.Final.jar; 赠送原API文档:netty-handler-proxy-4.1.68.Final-javadoc.jar; 赠送源代码:netty-handler-proxy-4.1.68.Final-sources.jar; 赠送Maven依赖信息文件:netty-...

    netty-handler-proxy-4.1.73.Final-API文档-中英对照版.zip

    赠送jar包:netty-handler-proxy-4.1.73.Final.jar; 赠送原API文档:netty-handler-proxy-4.1.73.Final-javadoc.jar; 赠送源代码:netty-handler-proxy-4.1.73.Final-sources.jar; 赠送Maven依赖信息文件:netty-...

    netty-handler-4.1.65.Final-API文档-中文版.zip

    赠送jar包:netty-handler-4.1.65.Final.jar; 赠送原API文档:netty-handler-4.1.65.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.65.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.65....

    netty-handler-4.1.74.Final-API文档-中文版.zip

    赠送jar包:netty-handler-4.1.74.Final.jar; 赠送原API文档:netty-handler-4.1.74.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.74.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.74....

    netty-handler-4.1.11.Final-API文档-中文版.zip

    赠送jar包:netty-handler-4.1.11.Final.jar; 赠送原API文档:netty-handler-4.1.11.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.11.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.11....

    netty-handler-4.1.23.Final-API文档-中文版.zip

    赠送jar包:netty-handler-4.1.23.Final.jar; 赠送原API文档:netty-handler-4.1.23.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.23.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.23....

    netty-handler-4.1.27.Final-API文档-中文版.zip

    赠送jar包:netty-handler-4.1.27.Final.jar; 赠送原API文档:netty-handler-4.1.27.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.27.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.27....

    netty-handler-4.1.16.Final-API文档-中文版.zip

    赠送jar包:netty-handler-4.1.16.Final.jar; 赠送原API文档:netty-handler-4.1.16.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.16.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.16....

    netty-handler-4.1.24.Final-API文档-中英对照版.zip

    赠送jar包:netty-handler-4.1.24.Final.jar; 赠送原API文档:netty-handler-4.1.24.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.24.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.24....

    netty-handler-4.1.11.Final-API文档-中英对照版.zip

    赠送jar包:netty-handler-4.1.11.Final.jar; 赠送原API文档:netty-handler-4.1.11.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.11.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.11....

    netty-handler-proxy-4.1.74.Final-API文档-中文版.zip

    赠送jar包:netty-handler-proxy-4.1.74.Final.jar; 赠送原API文档:netty-handler-proxy-4.1.74.Final-javadoc.jar; 赠送源代码:netty-handler-proxy-4.1.74.Final-sources.jar; 赠送Maven依赖信息文件:netty-...

    netty-handler-4.1.23.Final-API文档-中英对照版.zip

    赠送jar包:netty-handler-4.1.23.Final.jar; 赠送原API文档:netty-handler-4.1.23.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.23.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.23....

    netty-handler-4.1.27.Final-API文档-中英对照版.zip

    赠送jar包:netty-handler-4.1.27.Final.jar; 赠送原API文档:netty-handler-4.1.27.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.27.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.27....

    netty-handler-4.1.16.Final-API文档-中英对照版.zip

    赠送jar包:netty-handler-4.1.16.Final.jar; 赠送原API文档:netty-handler-4.1.16.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.16.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.16....

    netty-handler-4.1.73.Final-API文档-中英对照版.zip

    赠送jar包:netty-handler-4.1.73.Final.jar; 赠送原API文档:netty-handler-4.1.73.Final-javadoc.jar; 赠送源代码:netty-handler-4.1.73.Final-sources.jar; 赠送Maven依赖信息文件:netty-handler-4.1.73....

Global site tag (gtag.js) - Google Analytics