Class CookieResolver

java.lang.Object
fr.paris.lutece.portal.util.mvc.binding.AbstractParameterResolver
fr.paris.lutece.portal.util.mvc.binding.CookieResolver
All Implemented Interfaces:
ParameterResolver

@ApplicationScoped public class CookieResolver extends AbstractParameterResolver
This class resolves parameters annotated with CookieValue in the context of a web request. It extracts cookie values from the request and converts them to the appropriate type, handling default values and required cookies.

The CookieResolver is used to inject cookie values into methods annotated with MVC annotations, allowing for easy access to cookie data in web applications.

  • Constructor Details

    • CookieResolver

      public CookieResolver()
  • Method Details

    • supports

      public boolean supports(Parameter parameter)
      Checks if the resolver can handle the given parameter.
      Parameters:
      parameter - the parameter to check
      Returns:
      true if the resolver can handle the parameter, false otherwise
    • resolve

      public ResolverResult<?> resolve(jakarta.servlet.http.HttpServletRequest request, Parameter parameter)
      Resolves and converts the given parameter from the HTTP request.
      Parameters:
      request - the HTTP request
      parameter - the parameter to resolve
      Returns:
      the result of the resolution and conversion