This example demonstrates how to develop RESTful hello world web service in Scala with a Servlet 2.5 container.
The example consists of just one Scala class:
com.sun.jersey.samples.helloworldwebapp.resources.HelloWorldResource
The mapping of the URI path space is presented in the following table:
URI path | Resource class | HTTP methods |
---|---|---|
/helloworld | HelloWorldResource | GET |
Run the example as follows:
run
mvn glassfish:run
From a web browser, visit:
http://localhost:8080/scala-helloworld-webapp/helloworld