Package org.nuxeo.ecm.webengine.model.io
Class MultivaluedMapProvider
java.lang.Object
org.nuxeo.ecm.webengine.model.io.MultivaluedMapProvider
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<jakarta.ws.rs.core.MultivaluedMap<String,
String>>
@Consumes("application/x-www-form-urlencoded")
public class MultivaluedMapProvider
extends Object
implements jakarta.ws.rs.ext.MessageBodyReader<jakarta.ws.rs.core.MultivaluedMap<String,String>>
MultivaluedMap
can be used as parameter type of Jakarta RS method to retrieve the Form sent through the
request body, but as soon as one calls ServletRequest.getParameter(String)
or other similar APIs, the
request body is lost and Jersey/Jakarta RS doesn't read anything.
This provider is used to work around that, and maps the ServletRequest.getParameterMap()
to
MultivaluedMap
. This brings a consistent behavior, independently if something has called the parameter
methods or not.
- Since:
- 2025.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isReadable
(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) readFrom
(Class<jakarta.ws.rs.core.MultivaluedMap<String, String>> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
-
Field Details
-
request
@Context protected jakarta.servlet.http.HttpServletRequest request
-
-
Constructor Details
-
MultivaluedMapProvider
public MultivaluedMapProvider()
-
-
Method Details
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) -
readFrom
public jakarta.ws.rs.core.MultivaluedMap<String,String> readFrom(Class<jakarta.ws.rs.core.MultivaluedMap<String, String>> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
-