jax-rs

Postman client not able to parse string response from JAX-RS response builder

I am developing a jersey based REST application wherein i am using the response builder as below : return Response.status(Response.Status.UNAUTHORIZED).entity(e.getMessage()).build(); When executing this API in postman & when it generates this error , i see something like this : this comes only in...

Upload binary data with HTTP PUT with jersey jaxrs-ri-2.01

I am using jaxrs-ri-2.01 I would like to get in a parameter the binary data that is sent in the body of my HTTP PUT request. I have found one annotation that should do the trick : @FormDataParam but it does not seem to be available for the jaxrs-ri-2.01 I would like to know: if there's a way I can...

Securing Java Rest Service : JSON WebToken (JWT ) or oAuth 1.0?

I would like to know, JWT or oAuth 1.0 is best approach for securing Rest services.We are planning to develop a Dojo based web application and JAX-RS rest based web-service.Could someone help me on this ?. It will be really good if you can suggest some sample code for implementing the same in Java....

How to add relationships in JAX-RS via RESTful web service?

OK I can GET POST PUT DELETE simple resources (entities) in my RESTful web service ex. /rest/foos /rest/foos/1 /rest/bars /rest/bars/1 But how to handle adding relationships ex. @OneToMany, @ManyToMany between this relationships using RESTful web service. Suppose I have several Foo entities and...

JAX-RS 2.0: How to register a Feature or a ContextResolver to have a custom JaxbAnnotationIntrospector introspection registered in the Mapper

I have correctly registered JacksonJaxbJsonProvider in my JAX-RS 2.0 application using: public Set<Class<?>> getClasses() { ... classes.add(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider.class); } Now I need to customise the Mapper it self used in the JAX-RS resources because I need to add...

Inject EJB into JAX-RS 2.0 subresource when subresource is got via ResourceContext

I am using Jersey 2.8 with Glassfish 4.0. I have a resource locator class which looks like below @Path("/") @ManagedBean public class MyServiceLocator { @Context ResourceContext rc;//javax.ws.rs.container.ResourceContext @EJB private MyEJBHome myEJB; @Inject//javax.inject.Inject MySubService mss;...