When reading the official Oracle J2EE 6 Tutorial there are very few complete and runnable example. So in this blog I will have a go with a simple Hello World REST example. REST is build on top web service and some people might right now be sceptical. But the REST architecture is said to deliver. The other problem with web service, is that is so many implementation, depending on which platform you are deploying to. In this blog I will use the reference implementation of JAX-RS, Jersey - http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html.
After that said, lets get started with our first runnable Hello World REST example with Jersey.
And here is the web.xml that contains the dispatcher servlet.
And finally our pom.xml, that shows the jersey dependency and a maven jetty plugin, which we will use for running our example.
Now lets test our application.