Skip to content

Tag: jax-rs

Eclipse – Stuck “processing jax-rs changes”

I have installed Eclipse Mars2 and when I try to save changes I got a message saying “Processing JAX-RS changes… (Waiting)” and Eclipse freezes for a couple of minutes. I’m developing a spring-mvc maven based application using jboss as server (I don’t know whether this is relevan…

How to create REST API with optional parameters?

I need to implement an API with these path params. Can the second and third params by optional? So the client need not pass these, but have to pass the first and last. If this is not possible, then is it recommended to rearrange the params in this way? How to provide the optional params? Answer You can match …

Java 8 LocalDate Jackson format

For java.util.Date when I do then in JSON request when I send it works. How should I do this for Java 8’s LocalDate field?? I tried having It didn’t work. Can someone please let me know what’s the right way to do this.. Below are dependencies Answer I was never able to get this to work simpl…

JAX-RS MessageBodyReader

I’m learning how the MessageBodyReader method works from the providers. I see the method returns an object and I’m not sure how to access the object from a service. Could I get an explanation on how to get the object returned from the reader class? This would help me apply a reading rule for all D…

When to use @QueryParam vs @PathParam

I am not asking the question that is already asked here: What is the difference between @PathParam and @QueryParam This is a “best practices” or convention question. When would you use @PathParam vs @QueryParam. What I can think of that the decision might be using the two to differentiate the info…