response « jersey « Java Enterprise Q&A





1. JAX-RS Jersey - Howto force a Response ContentType? Overwrite content negotiation    stackoverflow.com

Jersey identifies requests by looking at the accept header. I have a request which accepts only text/* - How can i force the response to be for example application/json? @POST @Path("/create") @Produces(MediaType.APPLICATION_JSON) public MyResponseObject create() ...

2. rest + xop / binary data embedded in xml response    stackoverflow.com

I've been given the task to embed binary data (like pictures, music, thumbnails etc) into a xml metadata container in order to publish the whole package via REST interface. Currently we're ...

3. What's the difference between text/xml vs application/xml for webservice response    stackoverflow.com

This is more of a general question about the difference between text/xml and application/xml. I am fairly new to writing webservices (REST - Jersey). I have been producing application/xml since it is ...

4. Is it possible to control the filename for a Response from a Jersey Rest service?    stackoverflow.com

Currently I have a method in Jersey that retrieves a file from a content repository and returns it as a Response. The file can be a jpeg, gif, pdf, docx, html, ...

5. How to deserialize JSON response from Jersey REST service to collection of java objects    stackoverflow.com

I write client that makes GET request to REST service using Jersey Client API. Response is a collection of objects, and I need to deserialize it. Here is my code:

  ...

6. Custom HTTP status response with JAX-RS (Jersey) and @RolesAllowed    stackoverflow.com

With my very simple JAX-RS service I'm using Tomcat with JDBC realm for authentication, therefore I'm working the the JSR 250 annotations. The thing is that I want to return a custom ...

7. How to unmarshall JAX-RS Webservice response (JSON Array) correctly?    stackoverflow.com

I have some problem using Jersey REST webservices. I have the following domain class:

@XmlRootElement
public class User {

    private long id;
    private String email;
    ...

8. how to commit or flush the rest response in the middle of process    stackoverflow.com

I'm new to both java and jersey. Now I want to use the jersey to realize a REST services with extra processing after sending the response (specifically, sleep a fix amount ...

9. How can I add the same header/cookie to all JAX-RS responses?    stackoverflow.com

I want to add cookies to all JAX-RS responses produced in the application. How can I do this? I don't use Response class.





10. What is the correct HTTP Response to send in case of bad DNS Redirection?    stackoverflow.com

I've got a server hosting multiple websites. Server is written in Java+Jersey. If someone makes his DNS point to my service, but this DNS doesn't match any of my hosted websites, what ...

11. How to get response code and message when using jersey client    coderanch.com

Hi All, I am using com.sun.jersey.api.client.WebResource class to access a webservice. Can someone please point me to the method by which i can get the response code and message returned by the web service. currently i am using this method - webResource.head().getResponseStatus().getStatusCode() but it is always returning 404 code, which i guess is not currect. Thanks, Abhijeet

12. Jersey Response issue driving me batty!    coderanch.com

Hi, I'm using jersey 1.8 from the jersey bundle and running on glassfish 3.1. I'm writing a REST web service and all has been peachy, until I need to send a specific response code. Every time I try to get a ResponseBuilder object I get a very generic jersey exception. Here's my code: 1. @GET 2. @Path("/json/cid/{cid}/lang/{lang}") 3. @Produces(MediaType.APPLICATION_JSON) 4. public ...