Your First Cup: An Introduction to the Java EE Platform

Building and Deploying the Web Service

Build the JAX-RS web application and deploy it to your GlassFish Server instance.

ProcedureBuilding and Deploying the Web Service Endpoint

Compile, package, and deploy dukes-age.war to GlassFish Server. This task gives instructions on deploying dukes-age.war in NetBeans IDE.

  1. Select dukes-age in the Projects tab.

  2. Right-click dukes-age and select Run.

    After dukes-age.war deploys successfully to GlassFish Server a web browser will load the URL of the DukesAgeResource path, and you'll see the returned String representing Duke's age.


Example 3–1 Output of DukesAgeResource

Here's an example of the output of DukesAgeResource displayed in a web browser.


14