JAX-RS Tutorial

jax-rs tutorials

Java API for RESTful Web Services (JAX-RS), is a set if APIs to developer REST service. JAX-RS is part of the Java EE6, and make developers to develop REST web application easily.

In this series of JAX-RS tutorials, we use both Jersey and RESTEasy, popular JAX-RS implementation.

Happy learning JAX-RS :)

Quick Start

Some quick start examples to use JAX-RS.

Basic Examples

Basic annotations and functions to develop REST service.

File Upload Examples

How to handle multipart data in JAX-RS.

Working with XML

XML support in JAX-RS.

Working with JSON

JSON support in JAX-RS.

RESTful Java clients

Create a RESTful Java client to perform “GET” and “POST” request to manipulate json data.

JAX-RS + Spring

Integrate JAX-RS with Spring framework.

Common Error Messages

Some common error messages in JAX-RS development.

References

  1. Jersey official website
  2. Jersey user guide
  3. RESTEasy official website
  4. RESTEasy user guide
  5. REST explanation in Wiki
Tags :

About the Author

mkyong
Founder of Mkyong.com and HostingCompass.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

  • Pingback: water ionizer()

  • Pingback: water ionizers()

  • Pingback: streaming movies()

  • Pingback: tv online, online tv()

  • Pingback: stream movies()

  • Pingback: how to increase leptin()

  • Pingback: Blue Coaster33()

  • neha agrawal

    Hi MkYong,
    Thanks for your tutorials!! They are really informative. I couldn’t find any tutorial on Exception/error handling in REST as well as SOAP web service. It would be nice if you can share some example on this subject.

    Cheers,
    Neha

  • Aditya

    can you give the source code for Ejb + Jpa + Jsf + restful webservices.
    I want to Insert data into Deployement Server Database using Restful Client

  • Aprajita

    Thanks for your tutorials.
    I have been following you for a very long time. It is always been very helpful and informative.

  • vijayakumar

    hi, i am a beginner i want to know the difference between web service and web application.. can u explain me in detail..

  • Gnanasekaran Ebinezar

    Thanks a lot for your valable service to the IT Community.Whenever i want to learn any new things, i used to visit your site..Thanks a lot..

  • sandip kandari

    How I can deploy Restfull web service on Apache tomcat server.
    on web browser url if I write http://localhost:8080//index.jsp it display hello word.
    but after writing http://localhost:8080/Energymeter/resources/generic1. it is giving servlet adapter exception

    please tell me i can recover from this problem

  • http://nil Nirmal
  • Amit Kumar

    These examples are simple,tells you how RESTful Web Service work on basics.

  • http://klarys.com Kwesi Aryee

    An invaluable resource, very easy to understand.My first step into jax-rs has been really because of this tutorials

  • rafeeq

    Can you please provide an example where a xml payload is sent through REST POST method preferably using spring resttemplate

  • Ravi

    Hi Thanks for the above example , Could you please share the code for Displaying the JSON into JSP Page

  • K E Naresh

    Please explain about the flow of execution jax-rs jersey application

  • Pingback: REST | warrenburns()

  • gpsingh

    good that works

  • Pingback: Redshare – Eine Restful(le) Kontaktverwaltung…()

  • Nilman

    Thanks a lot for the tutorials. JAX-WS one was really helpful for me. Can you please publish something for Spring Web-Services?

    Thanks.
    -nilman

  • Rocky

    Can you post how to do integration testing of Restful services without hard-coding the base URL (can be different for each environment)
    DEV:8080/REST/TEST
    UAT:8080/REST/TEST

  • Sajith

    Simple and really useful

  • Ajay

    Need Help with @PUT and @DELETE type request and client for them..

  • Pingback: Kari's World » Blog Archive » REST in pieces()

  • Eduardo

    Yong those are great tutorials… Thank You!!! Could you post a tutorial about using OAuth for authenticating RestFul Web Services ?? It would be highly appreciated.

    Keep the good work!!!

    • Siregar

      Eduardo was right, could you post a tutorial about authenticating client in RestFul Web Services ?? Thank you

      • Ajay

        I am also waiting for a web site or good code from yong about securing Restful web services… Please post me if you got any worthy resource..!

        • Mikhail

          Yeah, it’s would be very interesting for me too.

  • Milind Kadam

    Hi Yong,

    I am first timer for Web Services. Trying to implement RESTful web service using JAX-RS Jersey APIs. I need to design stateless as well as stateful APIs. I guess I have very good idea on designing stateless APIs but to implement stateful APIs I need to manage session and client state on server. I know REST does not recommend this but this is the application requirement. Any suggestions how to implement stateful APIs? Thanks in advance.

    –Milind

  • Siregar

    is there a tutorial about security in rest? I mean is like implementation of authentication to access resources.

    Thank you.,

  • Siregar

    Have you tutorial or example about restful in struts2?
    Could you share it?

    • http://www.mkyong.com mkyong

      Struts2 + restful… a nice combination, may be in future :)

  • Roop

    Yong, could you please tell me, how can we handle/get form parameters in REST service when they are in quantity approx. 15 params?

    I am aware about @FormParam annotation, but if we cover all the 15 parameters, the method signature become quit long or we can say not readable.

    Is there any way ? so that we can directly populate the object based on said 15 form parameters.

    I heard about an annotation @Form objRef, but it is no longer exists.

    please provide your thoughts on this

    thanks,
    -Roop

    • pavan kalyan

      Thank you…!