类 DefaultServletHandlerConfigurer
java.lang.Object
cn.taketoday.web.config.DefaultServletHandlerConfigurer
Configures a request handler for serving static resources by forwarding
the request to the Servlet container's "default" Servlet. This is intended
to be used when the MVC
DispatcherServlet is mapped to "/"
thus overriding the Servlet container's default handling of static resources.
Since this handler is configured at the lowest precedence, effectively it allows all other handler mappings to handle the request, and if none of them do, this handler can forward it to the "default" Servlet.
- 从以下版本开始:
- 4.0 2022/2/15 17:10
- 作者:
- Rossen Stoyanchev, Juergen Hoeller, Harry Yang
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明DefaultServletHandlerConfigurer(ServletContext servletContext) Create aDefaultServletHandlerConfigurerinstance. -
方法概要
修饰符和类型方法说明protected SimpleUrlHandlerMappingReturn a handler mapping instance ordered atOrdered.LOWEST_PRECEDENCEcontaining theDefaultServletHttpRequestHandlerinstance mapped to"/**"; ornullif default servlet handling was not been enabled.voidenable()Enable forwarding to the "default" Servlet.voidEnable forwarding to the "default" Servlet identified by the given name.
-
字段详细资料
-
servletContext
-
handler
-
-
构造器详细资料
-
DefaultServletHandlerConfigurer
Create aDefaultServletHandlerConfigurerinstance.- 参数:
servletContext- the ServletContext to use.
-
-
方法详细资料
-
enable
public void enable()Enable forwarding to the "default" Servlet.When this method is used the
DefaultServletHttpRequestHandlerwill try to autodetect the "default" Servlet name. Alternatively, you can specify the name of the default Servlet viaenable(String). -
enable
Enable forwarding to the "default" Servlet identified by the given name.This is useful when the default Servlet cannot be autodetected, for example when it has been manually configured.
-
buildHandlerMapping
Return a handler mapping instance ordered atOrdered.LOWEST_PRECEDENCEcontaining theDefaultServletHttpRequestHandlerinstance mapped to"/**"; ornullif default servlet handling was not been enabled.
-