Service « jersey « Java Enterprise Q&A





1. Easiest frameworks to implement Java REST web services    stackoverflow.com

What are the best frameworks for implementing both client and server REST frameworks in Java? I've been struggling a little to find an easy to use solution. Update: Both Jersey and ...

2. Passing an object to a REST Web Service using Jersey    stackoverflow.com

I have a simple WS that is a @PUT and takes in an object

@Path("test")
public class Test {

    @PUT
    @Path("{nid}"}
    @Consumes("application/xml")
   ...

3. Java Async REST web service using Jersey?    stackoverflow.com

I need to implement a Java REST Web Service (we use Jersey framework) which can basically either a. block waiting for some event (or poll for the event), before returning the response b. ...

4. How do you return multipart content from a JAX-RS web service?    stackoverflow.com

I'd like to avoid embedding HTML in XML returned from my JAX-RS web service, but still be able to return both XML and HTML in the response to a single GET. Is ...

5. Flex 4 front end connecting to Java Jersey Web Service    stackoverflow.com

I created a Java REST service using Jersey. I use three of the HTTP "verbs" GET, POST and DELETE. I want to create several prototype front ends for the service. After ...

6. jersey webservice not returning jsonp    stackoverflow.com

I am trying to create a webservice that will return jsonp. At the moment it is only returning json Here is my code `@Path("/jsonp") public class JsonpWebservice {

@GET
@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
public JSONWithPadding readAllP(@QueryParam("jsoncallback") @DefaultValue("jsoncallback") String jsoncallback) 
{
 ...

7. jersey rest web services multiple format    stackoverflow.com

how to return the correct representation based on URI example /text.json should return json /text.xml should return xml /text should return plain text All these are mapped to the same method @GET public Contact getContacts() { }

8. JAX-RS REST Services as a library    stackoverflow.com

Is it possible to package my rest resource classes in a .jar library so that when they are included in someone's app that app gets the services? i am currently using jersey ...

9. @PostConstruct method called all the time on Jersey service    stackoverflow.com

Hi I'm using GigaSpaces XAP which basically uses Spring and ApplicationContext to do all it's init and config etc... At some point in time during the loading of the web application ...





10. Does Grizzly Project take care of buffer overflow or denial of service attacks?    stackoverflow.com

I have searched a lot, but still don't understand whether using Grizzly means that I am protected against those attacks or that I should do some more effort? Currently, the only thing ...

11. how to secure web service?    stackoverflow.com

i've created a web service (i think) that produces this output:

[{"MANAGER_ID":0,"DEPARTMENT_ID":90,"SALARY":24000,"HIRE_DATE":"1987-06-17","FIRST_NAME":"Steven","COMMISSION_PCT":0,"EMAIL":"SKING","EMPLOYEE_ID":100,"JOB_ID":"AD_PRES","PHONE_NUMBER":"515.123.4567","LAST_NAME":"King"}]
below is my code:
package resource;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.naming.NamingException;
import javax.sql.DataSource;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;

import org.json.JSONArray;
import org.json.JSONException;
import ...

12. Write proxy/wrapper class for own service in jersey    stackoverflow.com

I want to access a full rest service with basic http auth running. However there is no way to for the javascript browser client to suppress the authenticate box when a

13. How can I store information in the context of a web service?    stackoverflow.com

I use a web service which is responsible for user logins. If a login is successful, a token should be generated.

@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("/login")
public String login(@QueryParam("userName") String name,
       ...

14. Looking for a good tutorial how to develop odata service in Java (with restlet, jersey, or odata4j)    stackoverflow.com

I am looking for a tutorial that shows step by step how to develop an odata service using Java.

15. design issue with sending email notification while calling jersey service (PUT)    stackoverflow.com

I am having a design issue here. I have a RESTful web service implemented with jersey. I am also using spring mail to send email. My specification needs to ...

16. Send a HashMap using Jersey for REST web service    stackoverflow.com

I'm using Jersey for a REST webservice. I want to send a HashMap to the server, but I have a problem. This code works fine if I change parameter of the method ...





17. How to indicate the file name for saving to the browser from a REST service in Jersey?    stackoverflow.com

i am trying to have a REST service return a zip file from the local harddrive . Following is what i am doing ,

@Path("/interface3/{Entitlement_id}/{esf_app_id}/{esf_app_ver}")
public class Interface3Mock {

    // This ...

18. How to deliver .jad file using Jersey Rest service?    stackoverflow.com

I have to return a JavaME .jad file from restful web service (using Jersey), which is then used to install an app on a mobile phone. Before delivering the .jad file ...

19. How to set timeout for Jersey REST web services?    stackoverflow.com

I would like to know how to set a timeout for a REST web service with Jersey, and being able to catch it within the service. I've read some approaches to ...

20. Problem using the Activiti Rest web services    stackoverflow.com

Edit: to simplify my question, has anyone managed to communicate with Activiti using rest?, and if so could you be kind to post your code. thanks.
I've been ...

21. Web Services Between Java Jersey and Microsoft .NET    stackoverflow.com

I need to consume web services from a .NET web service and serve up a web service to a .NET client. I really like Jersey on the Java side but I'm ...

22. Filtering out service provider files from META-INF    stackoverflow.com

My application needs to run both from the command-line and a web app. The way I've chosen to implement this is to have the entire application in a single jar ...

23. Java : Is it possible to invoke webservices within a Thread?    stackoverflow.com

While working with jersey I wish to invoke / make a call to webservices within a thread. Is this possible? If possible please provide the fragment code.

24. Who's using Jersey for JAX-RS (JSR-311)?    coderanch.com

Just so we can band together and know whose brains we can try to pick (or even cry in our beer together), let's have a show of hands of people using the Jersey Project to set up a RESTful web services API that's JAX-RS (JSR-311) compliant. Me, obviously (or I wouldn't be asking). Ulf? William?

25. Problem with JERSEY and JAX-RS    coderanch.com

I am working in an existing established project, and it is using ASM 1.5.3, now how can i force jetty/maven to use ASM 3.1, as if i just put ASM 3.1 in repository, then hibernate starts giving exceptions, so can you please guide me that how can i force in POM.xml(or whatever), to use ASM 3.1 ?

26. Problem with Jersey / how to forward?    coderanch.com

Hello, Im new here, and like to introduce myself. Im a 25 years old student from Germany, hope my English is good enough that you understand where my problem is. Im developing a small WebApp with some other students. We are using a Tomcat 6 Server. Now we tried to switch from Servlets to Jersey 1.1. The problem is that our ...

27. Jersey jars    coderanch.com

On the Jersey web site, follow the "Jersey 1.1.4.1 Download now" button. It will lead you to a page that links to ALL jar files that you might conceivably need (it actually has way more than that, but the page describes what you need for which purposes). You should not use any other jar (like leftovers from version 0.5-ea).

28. Access object in Jersey    coderanch.com

I am using Jersey along with Spring. Now i need to get a XML file as input along with that a user object will also be passed by client. I need to fetch that and return it back without doing anything with that object. Can someone please let me know with some URL of tutorials or by pointing out some classes/methods ...

29. Using Jersey Bundle to call a SOAP based WS    coderanch.com

Why do you want to do that? Is there an actual problem using a proper SOAP stack with all its attendant benefits? If there's a proper abstraction layer on top of the WS access code then the client shouldn't care one way or the other what library is used underneath. Note that the article linked by Bhagat shows an approach that ...

30. HttpClient and MultipartEntity vs. Jersey Multipart    coderanch.com

Hello, I have a rest webservice that takes a POST metod with multipart message: @Path("transferFile") @POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_XML) public String multipartTest(com.sun.jersey.multipart.MultiPart data) { try { // get first body part (index 0) BodyPart bp = multiPart.getBodyParts().get(0); etc.. Now I am trying to write a java client for that. I started with a simple jersey client: MultiPart multiPart = new MultiPart(); multiPart.bodyPart( ...

31. Jersey REST -(Un)Marshaller    coderanch.com

Hello Java people, I have done some tests with Jersey Framework and it seems to have nice future :-) Nevertheless I have some questions. I found out that when I use Jersey framework and its API for web server and also for client application I do not need to marshal or unmarshal data received/sent by GET/POST requests. Is this true? Example ...

33. Jersey rest service issue    forums.oracle.com

D:. build.xml Client.java MyAnt.bat build index.html WEB-INF web.xml classes resources HelloResource.class lib asm-3.1.jar jackson-lgpl-0.9.4.jar jersey-client-1.0.2.jar jersey-core-1.0.2.jar jersey-json-1.0.2.jar jersey-server-1.0.2.jar jettison-1.0.1.jar jsr311-api-1.0.jar dist Hello.war lib asm-3.1.jar jackson-lgpl-0.9.4.jar jersey-client-1.0.2.jar ...