Class RequestBodyResolver

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

@ApplicationScoped public class RequestBodyResolver extends AbstractParameterResolver
Resolver for method parameters annotated with RequestBody. Extracts and deserializes the HTTP request body into the target object type.

This resolver supports JSON deserialization using Jackson ObjectMapper. It can handle various content types including application/json, application/xml, and plain text depending on the target parameter type.

  • Constructor Details

    • RequestBodyResolver

      public RequestBodyResolver()
  • 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