O'Reilly logo

Java EE Development with Eclipse by Deepak Vohra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and running a resource class

Next, we shall create a RESTful web service resource using a root resource class. A root resource class is a POJO, annotated with the @PATH annotation and consisting of at least one method annotated with the @PATH annotation or request method designator such as @GET, @PUT, @POST, or @DELETE. We shall create a root resource class with some resource methods using the @GET request method designator. Select File | New | Other and in the New wizard select Java | Class. Click on Finish. In New Java Class specify Source folder (EclipseJAX-RS/src), specify Package (jaxrs), and specify a class name (HelloWorldResource) in the Name field. Click on Finish, as shown in the following screenshot:

Annotate the Java class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required