Class MultipartRequestResolver
- All Implemented Interfaces:
ParameterResolver
MultipartHttpServletRequest.
This class is responsible for resolving multipart HTTP requests in the context of an MVC request.
It checks if the parameter type is MultipartHttpServletRequest and resolves the request object.
If the request is not of type MultipartHttpServletRequest, a ResolverResult.failed(T, java.util.List<fr.paris.lutece.portal.util.mvc.binding.BindingError>)
is returned with an appropriate error message.
This class is annotated with ApplicationScoped, meaning it is managed by the CDI container and shared
across the application.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionResolves the value of the given parameter from theHttpServletRequest.booleanDetermines whether this resolver supports the given parameter.
-
Constructor Details
-
MultipartRequestResolver
public MultipartRequestResolver()
-
-
Method Details
-
supports
Determines whether this resolver supports the given parameter.This method checks if the parameter type is
MultipartHttpServletRequest.- Specified by:
supportsin interfaceParameterResolver- Parameters:
parameter- The method parameter to check.- Returns:
trueif the parameter type isMultipartHttpServletRequest,falseotherwise.
-
resolve
public ResolverResult<?> resolve(jakarta.servlet.http.HttpServletRequest request, Parameter parameter) Resolves the value of the given parameter from theHttpServletRequest.This method casts the request to
MultipartHttpServletRequestif possible and returns it. If the request is not of typeMultipartHttpServletRequest, aResolverResult.failed(T, java.util.List<fr.paris.lutece.portal.util.mvc.binding.BindingError>)is returned with an appropriate error message.- Specified by:
resolvein interfaceParameterResolver- Parameters:
request- The HTTP request containing the multipart data.parameter- The method parameter to resolve.- Returns:
- A
ResolverResultcontaining the resolvedMultipartHttpServletRequestor an error if resolution fails.
-