I am trying to use JsonDeserialzer for the jax path parameter.
Here is my @BeanParam object,
@BeanParam private CustomerWrapper reference; @QueryParam("select") private String select; @QueryParam("count") private boolean count; @BeanParam PaginationInfo paginationInfo; @BeanParam private SortingInfo sortingInfo; @QueryParam("line") private String line; @QueryParam("typeCode") private String typeCode; class CustomReference { @NotNull @PathParam("profileReferenceId") @Encoded private String referenceId; public CustomerReference(String referenceId) { this.referenceId = referenceId; } public CustomeReference fromString() { return new CustomerReference(Base64.decode(referenceId)); } }
The referenceId field is base64 encoded, to decode it, I use jsondeserializer.
However, I read json messagereader, does not work with jax @ * parameters.
From another post, I realized that this can be achieved by creating javax.ws.rs.ext.ParamConverterProvider .
Example, @Provider public class TestClass implements ParamConverterProvider { private Logger logger = LoggerFactory.getLogger(TestClass.class); @Override public <T> ParamConverter<T> getConverter( Class<T> rawType, Type genericType, Annotation[] antns) { logger.debug("rawtype " +rawType.getName()); for(Annotation a : antns) { logger.debug("anotations " +a.annotationType().getName()); } return null; } } output: [DEBUG] 31 Oct 2016 23:20:23,788 DEBUG [http-nio-8082-exec-1] TestClass - rawtype boolean [DEBUG] 31 Oct 2016 23:20:23,788 DEBUG [http-nio-8082-exec-1] TestClass - anotations javax.ws.rs.QueryParam
why this converter recognizes only one request and ignores the others.
java jackson spring-boot jersey jax-rs
Bharath Nov 01 '16 at 6:24 2016-11-01 06:24
source share