This example demonstrates how to develop RESTful hello world web service in Scala with a Servlet 2.5 container.
The example consists of these Scala classes:
com.sun.jersey.samples.helloworldwebapp.resources.HelloWorldResource
com.sun.jersey.samples.helloworldwebapp.resources.MarkupResource
The mapping of the URI path space is presented in the following table:
URI path | Resource class | HTTP methods |
---|---|---|
/helloworld | HelloWorldResource | GET |
/markup | MarkupResource | GET |
If you are working with Jersey GlassFish update center module installed into your existing GlassFish instance, you will need to follow instructions at the module README file in order to deploy the example.
Otherwise, you can run the example using embedded GlassFish as follows:
run
mvn clean package embedded-glassfish:run
From a web browser, visit:
http://localhost:8080/scala-helloworld-webapp/helloworld
http://localhost:8080/scala-helloworld-webapp/markup