String « jersey « Java Enterprise Q&A

1. JAX-RS @PathParam How to pass a String with slashes, hyphens & equals too

I am new to JAX-RS and I am trying to use Jersey to build a simple RESTful Webservice. I have 2 questions. Please clarify these:

  1. I am trying to have my simple webservice ...

2. How to pass a very long string/file into RESTWebservice JAX-RS Jersey

I wrote a RESTful webservice using JAX-RS API, that returns an XML string. I am trying to write another RESTful webservice that takes in this XML string, does parsing of it using ...

3. unable to find com.sun.grizzly.tcp.http11.GrizzlyAdapter.setResourcesContextPath(String)

I trying to expose some groovy service with jersey and girzzly. but i got a wierd error when i'm launching my servlet container. Here is the snippet which lauch it:

ServletAdapter adapter = ...

4. Getting JSON as string to a model object with Jersey

We're currently using Jersey 1.5.1 + Spring for handling JSON requests, and the request structure looks something like this:

  "id": 34324242,
  "foo": "bar",
  "info": {

5. Jersey: Return a list of strings

I try to return a list of Strings in Jersey as JSON and XML. I thought this would be trivial. My first try was to write something like this

public List<String> get() {

6. Getting the real request string in Jersey

I'm having some trouble implementing a sort of oddball spec using Jersey, and it would help me if I could get the raw request string. Basically the spec calls for requests ...

7. Jersey:Returning a Response with a Map containing Image Files and JSON String values

I am using Jersey JAX-RS. I want to return a Response with a Map containing Image Files and JSON String values. Is this the right way to do this:

Map<String,Object> map = new ...

8. Download a PNG file from HTTP endpoint with query string

Sorry for the poor title. I have a URL like this: http://testserver:8080/dummy/server?@_1231Fv_C When I access this URL using browser, this returns me a PNG image. But, when I try to fetch ...

9. Can not construct instance xxxx, no suitable creator method found to deserialize from JSON String

I am trying to reconstruct java object from JSON string using jersey, and having some troubles to create object. Classes

@JsonIgnoreProperties(ignoreUnknown = true)
public class Contact {

    private long ...