In this example we are going to see how you can use java.net package utilities, to create RESTful clients that can consume simpele REST Services. It is not the easiest way to create a RESTful client, as you have to read the response yourself, as well as marshal and unmarshal Java Objects to some kind of stream, if that’s what ...
Read More »Home » Archives for Nikos Maravitsas »
JSON Example With RESTEasy + JAXB + Jettison
In this tutorial we are going to see how you can integrate RESTEasy with Jettison to develop JAX-RS RESTful services that produce and consume JSON streams. As you probably know, Jettison is a collection of APIs that are used to read and write JSON formatted streams. It can be coupled with XML serialization frameworks, like XStream, or JAXB used to marshal ...
Read More »JSON Example With RESTEasy + Jackson
In this tutorial we are going to see how you can integrate RESTEasy with Jackson to develop JAX-RS RESTful services that produce and consume JSON streams. As you probably know, Jackson is used to marshal a Java Object to JSON, and ummarshal a JSON file (or stream in general) to a Java Object In this example we are not going ...
Read More »JSON Example With Jersey and Jackson
In this post, we feature a comprehensive Example on JSON With Jersey and Jackson. We are going to see how you can integrate Jesrsey with Jackson to develop JAX-RS RESTful services that produce and consume JSON streams. As you probably know, Jackson is used to marshal a Java Object to JSON, and ummarshal a JSON file (or stream in general) to ...
Read More »XML Example With RESTEasy+ JAXB
In this example we are going to see how you can integrate RESTEasy with JAXB (Java Architecture for XML Binding) to create RESTful services that consume and produce XML streams. As you probably know JAXB is used to marshal a Java Object to XML, and ummarshal an XML file (or stream in general) to Java Object. In this example we are not going ...
Read More »XML Example With Jersey + JAXB
In this example we are going to see how you can integrate Jersey with JAXB (Java Architecture for XML Binding) to create RESTful services that consume and produce XML streams. As you probably know JAXB is used to marshal a Java Object to XML, and ummarshal an XML file (or stream in general) to Java Object. You don’t have to ...
Read More »RESTEasy File Upload Example
In this tutorial we are going to see how In this example we are going to see how you can upload a File to a server using a JAX-RS REST Service using RESTEasy. In this example we are going to use an HTML Form that has one input field of type file. When the HTTP POST request is constructed, it ...
Read More »Jersey File Upload Example
In this example we are going to see how you can upload a File to a server using a JAX-RS REST Service using Jersey. Uploading a File using Jersey is fairly easy, as it uses all the HTTP infrastructure for file upload operations. In this example we are going to use an HTML Form that has one input field of ...
Read More »JAX-RS Download File
In this example we are going to see how you can download a file from a JAX-RS REST Service. It’s significantly easy to do that, as it requires to annotate the bind method with the @Produces annotation. The @Produces annotation can used to used to specify the MIME media types a service can produce and send to the client. In ...
Read More »Get HTTP Header In JAX-RS
In this example we are going to see how to get Request HTTP Header parameters in a JAX-RS REST Service. You can see the list of all Header fields in the HTTP 1.1 RFC. To be able to parse HTTP Header fields you can either use @HeaderParam to parse each Header field individually, or use @Context to inject an HttpHeaders object ...
Read More »