Questions tagged [jersey-1.0]

Jersey 1.0 is the open source, production quality, JAX-RS 1.1 (JSR 311) reference implementation for building RESTful Web services. Only use this tag if your question specifically pertains to Jersey 1.0.

Jersey 1.0 is the open source, production quality, JAX-RS 1.1 (JSR-311) reference implementation for building RESTful Web services. Jersey provides an API so that developers may extend Jersey to suit their needs. The governance policy is the same as the one used in the GlassFish project.

204 questions
6
votes
2 answers

Jersey - execute 'common' code before running a selected set of subresources

I have a Java Web application which uses Jersey to expose a REST API. @Path("/myRootResource") public class resource { @GET @Path("subResource_1") public Response subResource_1() {return null;} @GET @Path("subResource_2") …
Athafoud
  • 2,898
  • 3
  • 40
  • 58
6
votes
1 answer

Jersey Image Upload Client

I am trying to upload image using Jersey webservice , i am using jersey client to upload image. below is jersey web service which takes inputstream and uploads image on server. it works fine when i directly call it using jsp multipart form upload…
Jitendra Kumawat
  • 133
  • 1
  • 2
  • 12
6
votes
1 answer

I have an overloaded setter on an object, how can I tell Jackson to ignore one of them?

I'm using Jersey 1.17 with com.sun.jersey.api.json.POJOMappingFeature set to true and I'm POSTing an object that looks like this: import com.fasterxml.jackson.annotation.JsonIgnore; import javax.xml.bind.annotation.XmlRootElement; import…
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
5
votes
1 answer

Jersey Migration from 1.19 to 2.25 Maven Dependencies

I am migrating from Jerser 1.19 to Jersey 2.25 com.sun.jersey jersey-server 1.19 compile
Patan
  • 17,073
  • 36
  • 124
  • 198
5
votes
1 answer

Upgrading from Jersey Client 1.x to Jersey Client 2.x

I am using jersey-client-1.9. sample code: import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; Client client = Client.create(); webResource =…
Dev
  • 13,492
  • 19
  • 81
  • 174
5
votes
1 answer

How to have Jersey pass malformed headers

I'm using Jersey 1.12 and have an endpoint that may or may not receive malformed headers from clients that i don't control (for instance "Content-Type":"application/json; bla-bla") Obviously bla-bla is malformed as the spec requires parameters to…
danf
  • 2,629
  • 21
  • 28
5
votes
1 answer

Can I use CDI to @Inject a class in Jersey 1.x?

I think I'm asking this question but for Jersey 1.x: Dependency injection with Jersey 2.0 I'm using Glassfish 3, CDI and Jersey 1.x. I have a @WebService that is injecting a class like this: @Inject Foo foo; I've tested this in the @WebService and…
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
5
votes
1 answer

Implementing RESTful web service with two parameters?

I am writing Jersey RESTful web services. I have below two web methods. @Path("/persons") public class PersonWS { private final static Logger logger = LoggerFactory.getLogger(PersonWS.class); @Autowired private PersonService…
user755806
  • 6,565
  • 27
  • 106
  • 153
4
votes
2 answers

How to use two versions of Jackson (1.x and 2.x) in the same Jersey JAX-RS application?

I work in a project with an old version of Jersey (1.19) along with old Jackson (1.19.13). I would like to switch, to new Jackson (2.x) deserialization, but only for new endpoints (and old ones gradually) because migration in one step to Jackson 2…
Michał Wróbel
  • 558
  • 1
  • 4
  • 13
4
votes
1 answer

How to disable chunked encoding and use buffered for Jersey 1?

I am encountering a HTTP response status of 411 Length Required when performing a call to a 3rd party service in my application. The problem seems to be related to chuncked encoding, switching it to buffered would solve the problem. There is a…
Flowryn
  • 1,437
  • 1
  • 16
  • 32
4
votes
1 answer

Jersey 1.x is replacing the plus symbol with a space symbol. How can I prevent this?

I'm using the jersey client to send a query param to my jersey server. This is the query: ?sort=id+ASC But in my code that retrieves this query param, return uriInfo.getQueryParameters().getFirst("sort");, this value evaluates to id ASC. Why is…
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
4
votes
4 answers

How do I tell the Jersey Client to do the equivalent of @JsonIgnoreProperties(ignoreUnknown = true) on every class it deserializes?

I have a class that I'm using the Jersey Client to deserialize. This class has a method that looks like this: public boolean isEmpty() { return (code == null && label == null && codeSystem == null && …
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
4
votes
1 answer

Jersey @Consumes @Produces not accepted by the server ,

I have the following class : package test import org.apache.log4j.Logger; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @Path("/test") public class test { private static Logger logger =…
user1801279
  • 1,743
  • 5
  • 24
  • 40
4
votes
2 answers

Custom provider can't inject into filter

I have a POJO that I'd like to inject into resources and filters: public final class MyObject { } I implemented a custom provider for it: @Provider public final class MyProvider extends AbstractHttpContextInjectable implements…
Paul Bellora
  • 54,340
  • 18
  • 130
  • 181
4
votes
1 answer

Jersey: How to get the URI of a resource?

ResourceContext.matchResource(URI) allows me to convert a URI to a Resource, but how do I go from a Resource to its URI?
Gili
  • 86,244
  • 97
  • 390
  • 689
1
2
3
13 14