Class ModelAttributeResolver

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

@ApplicationScoped public class ModelAttributeResolver extends Object implements ParameterResolver
This class resolves parameters annotated with ModelAttribute in the context of a web request. It extracts model attributes from the request and converts them to the appropriate type, handling binding errors.

The ModelAttributeResolver is used to inject model attributes into methods annotated with MVC annotations, allowing for easy access to model data in web applications.

  • Constructor Details

    • ModelAttributeResolver

      public ModelAttributeResolver()
  • Method Details

    • supports

      public boolean supports(Parameter parameter)
      Checks if the resolver can handle the given parameter.
      Specified by:
      supports in interface ParameterResolver
      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.
      Specified by:
      resolve in interface ParameterResolver
      Parameters:
      request - the HTTP request
      parameter - the parameter to resolve
      Returns:
      the result of the resolution and conversion