JAX – RS @ApplicationPath Annotation(no web.xml)Example in jersey

In this tutorial we will learn how to develop a restful web services application with out web.xml. We have an annotation @ApplicationPath provided by JAX – RS which is used to achieve this. This can be used only in above servelt3.0 complaint containers (ex:Tomcat7 …). let us have a small example. 1. Create Dynamic web project in […]

JAX – RS Sub Packages Scan configuration Example

In this example we will see how Jersey will automatically discover the resources and providers in the selected packages and sub packages. This can be achieved by configuring properties in web.xml by using <init-param>  like as below.  

    1. Create Dynamic web project in Eclipse.     2. Write Java Resource classes.


JAX – RS Multiple Resource Packages configuration

In general we will have a lot of resource packages in our restful enterprise application , to configure all the packages we need to know the mechanism. In this tutorial we will learn how to configure Multiple Resource Packages in restful enterprise application. <init-param> tag is used to configure Multiple Resource Packages in deployment descriptor which is web.xml like […]

Difference between com.sun.jersey.spi.container.servlet.ServletContainer and com.sun.jersey.spi.container.servlet.ServletContainer

In this article we will see some of the differences between Jersey 1.x and Jersey 2.x . here I am going to explain what is the main web.xml configuration change in Jersey 1.x and Jersey 2.x frameworks .   In Jersey 1.x Framework we configure com.sun.jersey.spi.container.servlet.ServletContainer as servlet in web.xml , where as in  Jersey 2.0 on wards we are […]

JAX – RS Hello world example in Jersey 1.x

In this tutorial we see hello world example in jersey 1.x . There will be lot of differences between jersey 1.x and 2.x. The main purpose of this post is just want explain the configurations required for specific version of Jersey Framework. let us have a jump into example code in Jersey 1. what is the main difference […]

JAX-RS @DefaultValue Annotation Restful Example in Java

In this tutorial we see what is the use of @DefaultValue in JAX – RS. @DefaultValue annotation is used to set the default values  and make them available to java method to in our java service class. Let us have a example how to implement  @DefaultValue annotation in JAX-RS 1. Create Dynamic web project in Eclipse. 2. Write Java […]