Questions tagged [jax-rs]

JAX-RS: Java API for RESTful Web Services. It is an API that provides support in creating web services according to the REST architectural style.

JAX-RS: API for RESTful Web Services is an API that provides support in creating web services according to the architectural style. JAX-RS uses annotations, introduced in Java SE 5, to simplify the development and deployment of web service clients and endpoints. From version 1.1 on, JAX-RS is an official part of Java EE.

The home for the JAX-RS JSRs is on Java.net.

JAX-RS is implemented by the following frameworks:

Resources:

7676 questions
3
votes
1 answer

Using Springfox to document jax-rs services in a Spring app

I want to document the API of an existing app using Springfox. I added these dependencies to pom.xml: io.springfox springfox-swagger2
Don Branson
  • 13,631
  • 10
  • 59
  • 101
3
votes
1 answer

CDI and Resource Injection with JAX-RS and Glassfish

I'm currently developing a JAX-RS Servlet which I then want to deploy in a Glassfish 4.1 Server (consequently the JAX-RS runtime is Jersey 2.x). Instead of going with Spring for the configuration and DI stuff, I wanted to try out the Java EE way of…
htipk
  • 109
  • 3
  • 10
3
votes
1 answer

Configuration of Apache CXF CrossOriginResourceSharingFilter with Spring

How can I configure the Apache CXF CrossOriginResourceSharingFilter without changing the source code (annotated class or beans.xml)? In the JAX-RS: CORS example the configuration is hard-coded: Here is the test code showing how…
dur
  • 15,689
  • 25
  • 79
  • 125
3
votes
0 answers

How to implement Update operation on JAX-RS resource using Hibernate JPA

I am very new to Java programming language and even newer to frameworks like JAX-RS and Hibernate. In short I have to implement CRUD operations for one of the Hibernate entities in my JAX-RS application and need help for implementing Update…
Chesser
  • 455
  • 3
  • 9
3
votes
1 answer

Dropwizard and Protocol Buffers by example

Please note: Although this question specifically mentions Dropwizard, I believe anyone with Jersey/JAX-RS experience should be able to answer this question, as I would imagine Dropwizard is just following Jersey/JAX-RS conventions under the hood. I…
smeeb
  • 27,777
  • 57
  • 250
  • 447
3
votes
1 answer

Mapping WebApplicationExceptions

I am wondering what the proper use is for the Javax-RS/Jersey ExceptionMapper class when it comes to mapping WebApplicationExceptions I like the following, simple, 3-status paradigm: HTTP 200 OK indicates successful response, no errors at all…
smeeb
  • 27,777
  • 57
  • 250
  • 447
3
votes
2 answers

Passing the URI Path to the JAX-RS Providers

I recently implemented a Jersey JAX-RS Rest service. I created a JIBX provider that allows one to unmarshal and marshall between XML and Java types. I would like to also version my service by specifying the version in the URL path. Versioning…
onejigtwojig
  • 4,771
  • 9
  • 32
  • 35
3
votes
6 answers

Best way to implement method OPTIONS in REST services

I'm doing a REST application. I have made the GET method without issues, however, when I implement the POST method, it says that I don't have the OPTIONS method implemented for it. I am doing the OPTIONS method for…
3
votes
3 answers

System wide adapter in Jersey?

I'm trying configure a "system wide" custom javax.xml.bind.annotation.adapters.XmlAdapter for the java.util.Locale type in Jersey. It's easy enough to use @XmlJavaTypeAdapter on classes I control but that's not always the case (3rd party code that…
danw
  • 1,528
  • 1
  • 17
  • 17
3
votes
0 answers

jax-rs messagebodywriter with collection

I have defined the following jax-rs MessageBodyWriter: @Provider @ApplicationScoped @Produces(MediaType.APPLICATION_JSON) public class CustomerMessageBodyWriter implements MessageBodyWriter .... } Additionally, my rest-endpoint looks like…
maress
  • 3,533
  • 1
  • 19
  • 37
3
votes
2 answers

java.lang.NoSuchMethodError: org.jboss.resteasy.specimpl.BuiltResponse.getHeaders()Ljavax/ws/rs/core/MultivaluedMap

I develop Restful web service. I want output as XML type(VXML). I try like this. I use Java 8, Maven, Jersey and same as new technology. I get details from that web address link. this my example code for request catch…
Thilina Sampath
  • 3,615
  • 6
  • 39
  • 65
3
votes
1 answer

Modifying the Apache cxf JAX RS response using outbound interceptor

I have developed Rest Application (JAX RS) using Apache CXF. CXF configuration:
Vis
  • 263
  • 1
  • 2
  • 11
3
votes
1 answer

JAX-RS Jersey client gets 400 response when web method parameters are annotated

Here is my web service method: @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @POST @Path("login") public Response login(@NotNull @Valid Credentials credentials) { // do login } And here is the snippet of the client…
jFrenetic
  • 5,384
  • 5
  • 42
  • 67
3
votes
1 answer

How to use Jersey's internal routing mechanism to extract a class/method reference?

I have a Jersey 1.8 application running. Jersey is running as a Servlet. I need to write a servlet filter that given a plain request/response, is able to figure out which REST resource/method will respond to the request and extract values from…
Alejandro
  • 635
  • 1
  • 6
  • 16
3
votes
2 answers

remove null value field from apache cxf REST response

I'm using apache-cxf 2.7.11 + jackson (codehaus) 1.9.13 + spring 3.5 in my REST services web-container. I was wondering what would be the best way to remove null value fields from REST responses. For example: My response is now like this: { …
Ziv Levy
  • 1,904
  • 2
  • 21
  • 32
1 2 3
99
100