Class PathVariableResolver

java.lang.Object
net.kaczmarzyk.spring.data.jpa.utils.PathVariableResolver

public abstract class PathVariableResolver extends Object
* * The primary extraction method extracts resolved variables from request attributes. * However, due to the fact that the presence of resolved variables in request attributes is not guarantee (ref: HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE * there is a fallback mechanism which is being used in case of missing resolved variables in request attributes. * * The fallback approach, resolves variables by comparison of: * * actual request path - HttpServletRequest.getPathInfo() or HttpServletRequest.getRequestURI() (when getPathInfo() is a null) * * path pattern - it is calculated using information included in the annotations: @RequestMapping, @GetMapping on the method and class level. * The fallback mechanism does not support URIs consisting from global prefix defined for example via: PathMatchConfigurer::addPathPrefix
Author:
Tomasz Kaczmarzyk, Jakub Radlica
  • Constructor Details

    • PathVariableResolver

      public PathVariableResolver()
  • Method Details

    • resolvePathVariables

      public static Map<String,String> resolvePathVariables(org.springframework.web.context.request.NativeWebRequest nativeWebRequest, org.springframework.core.MethodParameter methodParameter)