map « jersey « Java Enterprise Q&A

1. Java library to map request parameters onto an object

I have used stipes on a project in the past, and it has a great TypeConverter library that can take request parameters and route them into JavaBeans. It can even ...

2. Mapping methods in Jersey framework

Is it possible to map methods to methods calls to URL path both with ID and with parameters? For instance: http://localhost/ws/updateUser/32332?name=John?psw=123 public void updateUser(Sting name, String psw){..} It seems that current @PathParam annotation supports ...

3. How can I map semicolon-separated PathParams in Jersey?

Is there a way to use this parameter style:

in JAX-RS with Jersey? If I use PathParam, only the first parameter in the list is returned. I tried to escape ...

4. How do you map multiple query parameters to the fields of a bean on Jersey GET request?

A service class has a @GET operation that accepts multiple parameters. These parameters are passed in as query parameters to the @GET service call.

public FindResponse find(@QueryParam("prop1") String prop1, 

5. How to map a path suffix to a query parameter using Java Jersey?

Background: we have build a RESTful API using Jersey a while ago where we map the uri /items.json to a json array of ids and /items/{id}.json to the json object of ...

6. Customising Jersey JSON marshalling for java.util.Maps

By default, marshalling a @XmlRootElement bean containing a map gives the structure:

myMap : {
    entry : {
        key : {

7. Jersey JSONConfiguration FEATURE_POJO_MAPPING - how to skip unwanted entries during deserialization

I'm defining pojos for facebook objects, which can be consumed by clients who dont have the capacity to parse JSON. Some of the FB object's data structure is loosely defined, like ...

8. Separate Exception mapping for REST web service / Web UI service

I have written a web service with Jersey. This web service provides both REST methods to be accessed via a REST client, and a User WebUI (basically simple HTML). Those two aspects are ...

9. JAX-RS and Jersey: SEVERE: Mapped exception to response: 501

We've got a JAX-RS resource method that handles GET requests for our resource. That GET method is currently unimplemented and we'd like to return a response code that says so. We ...

10. Jersey Getting a HTTP 405, path mapping not handled as expected

I have the following 2 methods...

public Response test(@PathParam("solution") String solution,
        @Context UriInfo uriInfo, @Context HttpHeaders headers);

public Response testTest(@PathParam("solution") String solution,

11. Jersey (REST) throw exception and map to HTTP error or return custom error code?

Basically I written a REST service and my business logic requires me to validate the input. For instance make sure the format of phone number is (###)###-####. If it is not, ...