public class WebSocketHandlerMapping
extends org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
implements org.springframework.context.SmartLifecycle
SimpleUrlHandlerMapping with support for more
precise mapping of WebSocket handshake requests to handlers of type
WebSocketHttpRequestHandler. Also delegates Lifecycle
methods to handlers in the SimpleUrlHandlerMapping.getUrlMap() that implement it.mappingsLoggerBEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, LOOKUP_PATH, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE| Constructor and Description |
|---|
WebSocketHandlerMapping() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
getHandlerInternal(HttpServletRequest request) |
protected void |
initServletContext(ServletContext servletContext) |
boolean |
isRunning() |
void |
setWebSocketUpgradeMatch(boolean match)
When this is set, if the matched handler is
WebSocketHttpRequestHandler, ensure the request is a WebSocket
handshake, i.e. |
void |
start() |
void |
stop() |
getUrlMap, initApplicationContext, registerHandlers, setMappings, setUrlMapbuildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerMap, getPathPatternHandlerMap, getRootHandler, lookupHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setPatternParser, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandleradaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurationSource, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getPatternParser, getUrlPathHelper, hasCorsConfigurationSource, initInterceptors, initLookupPath, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper, usesPathPatternsgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, isContextRequired, setServletContextgetApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPhase, isAutoStartup, stoppublic void setWebSocketUpgradeMatch(boolean match)
WebSocketHttpRequestHandler, ensure the request is a WebSocket
handshake, i.e. HTTP GET with the header "Upgrade:websocket",
or otherwise suppress the match and return null allowing another
HandlerMapping to match for the
same URL path.match - whether to enable matching on "Upgrade: websocket"protected void initServletContext(ServletContext servletContext)
initServletContext in class org.springframework.web.context.support.WebApplicationObjectSupportpublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecycle@Nullable protected Object getHandlerInternal(HttpServletRequest request) throws Exception
getHandlerInternal in class org.springframework.web.servlet.handler.AbstractUrlHandlerMappingException