Interface HandlerMethodMappingNamingStrategy<T>

Type Parameters:
T - the mapping type
All Known Implementing Classes:
RequestMappingInfoHandlerMethodMappingNamingStrategy
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface HandlerMethodMappingNamingStrategy<T>
A strategy for assigning a name to a handler method's mapping.

The strategy can be configured on AbstractHandlerMethodMapping. It is used to assign a name to the mapping of every registered handler method. The names can then be queried via AbstractHandlerMethodMapping#getHandlerMethodsForMappingName.

Applications can build a URL to a controller method by name with the help of the static method MvcUriComponentsBuilder#fromMappingName or in JSPs through the "mvcUrl" function registered by the Spring tag library.

Since:
4.1
Author:
Rossen Stoyanchev
  • Method Summary

    Modifier and Type
    Method
    Description
    getName(HandlerMethod handlerMethod, T mapping)
    Determine the name for the given HandlerMethod and mapping.
  • Method Details

    • getName

      String getName(HandlerMethod handlerMethod, T mapping)
      Determine the name for the given HandlerMethod and mapping.
      Parameters:
      handlerMethod - the handler method
      mapping - the mapping
      Returns:
      the name