Build the JAX-RS web application and deploy it to your GlassFish Server instance.
Compile, package, and deploy dukes-age.war to GlassFish Server. This task gives instructions on deploying dukes-age.war in NetBeans IDE.
Select dukes-age in the Projects tab.
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.
Here's an example of the output of DukesAgeResource displayed in a web browser.