Package jetbrains.spring.web
Class UrlMapping
- java.lang.Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- org.springframework.web.context.support.WebApplicationObjectSupport
-
- org.springframework.web.servlet.handler.AbstractHandlerMapping
-
- jetbrains.spring.web.TeamCitySimpleUrlHandlerMapping
-
- jetbrains.spring.web.UrlMapping
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.ApplicationContextAware,org.springframework.core.Ordered,org.springframework.web.context.ServletContextAware,org.springframework.web.servlet.HandlerMapping
public class UrlMapping extends TeamCitySimpleUrlHandlerMapping
- Author:
- Kir
-
-
Field Summary
-
Fields inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
mappingsLogger
-
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_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 Summary
Constructors Constructor Description UrlMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCustomHandler(CustomUrlHandler handler)voidaddHandler(String urlPath, org.springframework.web.servlet.mvc.Controller controller)protected org.springframework.web.servlet.HandlerExecutionChaingetCorsHandlerExecutionChain(javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.HandlerExecutionChain chain, org.springframework.web.cors.CorsConfiguration config)String[]getOmittingPrefixes()protected booleanisContextRequired()protected ObjectlookupHandler(String urlPath, javax.servlet.http.HttpServletRequest request)Look up a handler instance for the given URL path.protected voidregisterHandler(String urlPath, Object handler)Register the specified handler for the given URL path.voidsetOmittingPrefixes(String[] omittingPrefixes)ObjectunregisterHandler(String urlPath)Unregister handler for the given URL path-
Methods inherited from class jetbrains.spring.web.TeamCitySimpleUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getRootHandler, getUrlMap, initApplicationContext, initInterceptors, registerHandlers, setLazyInitHandlers, setMappings, setRootHandler, setUrlMap, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandler
-
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurationSource, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getPatternParser, getUrlPathHelper, hasCorsConfigurationSource, initLookupPath, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setPatternParser, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper, usesPathPatterns
-
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, setServletContext
-
-
-
-
Method Detail
-
addHandler
public void addHandler(@NotNull String urlPath, @NotNull org.springframework.web.servlet.mvc.Controller controller) throws org.springframework.beans.BeansException- Throws:
org.springframework.beans.BeansException
-
unregisterHandler
public Object unregisterHandler(String urlPath)
Description copied from class:TeamCitySimpleUrlHandlerMappingUnregister handler for the given URL path- Overrides:
unregisterHandlerin classTeamCitySimpleUrlHandlerMapping- Returns:
- removed handler instance or handler bean name String
-
addCustomHandler
public void addCustomHandler(@NotNull CustomUrlHandler handler) throws org.springframework.beans.BeansException- Throws:
org.springframework.beans.BeansException
-
registerHandler
protected void registerHandler(@NotNull String urlPath, @NotNull Object handler) throws org.springframework.beans.BeansException, IllegalStateExceptionDescription copied from class:TeamCitySimpleUrlHandlerMappingRegister the specified handler for the given URL path.- Overrides:
registerHandlerin classTeamCitySimpleUrlHandlerMapping- Parameters:
urlPath- the URL the bean should be mapped tohandler- the handler instance or handler bean name String (a bean name will automatically be resolved into the corresponding handler bean)- Throws:
org.springframework.beans.BeansException- if the handler couldn't be registeredIllegalStateException- if there is a conflicting handler registered
-
lookupHandler
protected Object lookupHandler(String urlPath, javax.servlet.http.HttpServletRequest request) throws Exception
Description copied from class:TeamCitySimpleUrlHandlerMappingLook up a handler instance for the given URL path.Supports direct matches, e.g. a registered "/test" matches "/test", and various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the AntPathMatcher class.
Looks for the most exact pattern, where most exact is defined as the longest path pattern.
- Overrides:
lookupHandlerin classTeamCitySimpleUrlHandlerMapping- Parameters:
urlPath- URL the bean is mapped torequest- current HTTP request (to expose the path within the mapping to)- Returns:
- the associated handler instance, or
nullif not found - Throws:
Exception- See Also:
TeamCitySimpleUrlHandlerMapping.exposePathWithinMapping(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest),AntPathMatcher
-
getOmittingPrefixes
@NotNull public String[] getOmittingPrefixes()
-
setOmittingPrefixes
public void setOmittingPrefixes(String[] omittingPrefixes)
-
isContextRequired
protected boolean isContextRequired()
- Overrides:
isContextRequiredin classorg.springframework.web.context.support.WebApplicationObjectSupport
-
getCorsHandlerExecutionChain
protected org.springframework.web.servlet.HandlerExecutionChain getCorsHandlerExecutionChain(javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.HandlerExecutionChain chain, org.springframework.web.cors.CorsConfiguration config)- Overrides:
getCorsHandlerExecutionChainin classorg.springframework.web.servlet.handler.AbstractHandlerMapping
-
-