类 InfraMockServletContext
java.lang.Object
cn.taketoday.mock.web.MockServletContext
cn.taketoday.framework.test.mock.web.InfraMockServletContext
- 所有已实现的接口:
jakarta.servlet.ServletContext
MockServletContext implementation for Infra. Respects well-known Infra
Boot resource locations and uses an empty directory for "/" if no locations can be
found.- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb
-
字段概要
字段修饰符和类型字段说明private Fileprivate static final String[]private final cn.taketoday.core.io.ResourceLoader从接口继承的字段 jakarta.servlet.ServletContext
ORDERED_LIBS, TEMPDIR -
构造器概要
构造器构造器说明InfraMockServletContext(String resourceBasePath) InfraMockServletContext(String resourceBasePath, cn.taketoday.core.io.ResourceLoader resourceLoader) -
方法概要
修饰符和类型方法说明private booleangetResource(String path) protected final Stringprotected StringgetResourceLocation(String path) Build a full resource location for the given path, prepending the resource base path of thisMockServletContext.从类继承的方法 cn.taketoday.mock.web.MockServletContext
addFilter, addFilter, addFilter, addInitParameter, addJspFile, addListener, addListener, addListener, addMimeType, addServlet, addServlet, addServlet, createFilter, createListener, createServlet, declareRoles, getAttribute, getAttributeNames, getClassLoader, getContext, getContextPath, getDeclaredRoles, getDefaultServletName, getDefaultSessionTrackingModes, getEffectiveMajorVersion, getEffectiveMinorVersion, getEffectiveSessionTrackingModes, getFilterRegistration, getFilterRegistrations, getInitParameter, getInitParameterNames, getJspConfigDescriptor, getMajorVersion, getMimeType, getMinorVersion, getNamedDispatcher, getRealPath, getRequestCharacterEncoding, getRequestDispatcher, getResourceAsStream, getResourcePaths, getResponseCharacterEncoding, getServerInfo, getServletContextName, getServletRegistration, getServletRegistrations, getSessionCookieConfig, getSessionTimeout, getVirtualServerName, log, log, registerContext, registerNamedDispatcher, removeAttribute, setAttribute, setContextPath, setDefaultServletName, setEffectiveMajorVersion, setEffectiveMinorVersion, setInitParameter, setMajorVersion, setMinorVersion, setRequestCharacterEncoding, setResponseCharacterEncoding, setServletContextName, setSessionTimeout, setSessionTrackingModes, unregisterNamedDispatcher
-
字段详细资料
-
RESOURCE_LOCATIONS
-
resourceLoader
private final cn.taketoday.core.io.ResourceLoader resourceLoader -
emptyRootDirectory
-
-
构造器详细资料
-
InfraMockServletContext
-
InfraMockServletContext
public InfraMockServletContext(String resourceBasePath, cn.taketoday.core.io.ResourceLoader resourceLoader)
-
-
方法详细资料
-
getResourceLocation
从类复制的说明:MockServletContextBuild a full resource location for the given path, prepending the resource base path of thisMockServletContext.- 覆盖:
getResourceLocation在类中MockServletContext- 参数:
path- the path as specified- 返回:
- the full resource path
-
getResourceBasePathLocation
-
exists
-
getResource
- 指定者:
getResource在接口中jakarta.servlet.ServletContext- 覆盖:
getResource在类中MockServletContext- 抛出:
MalformedURLException
-