Tag Archives: JAX-RX

Creating Web Services and a Rest Server with JAX-RX and Jetty


via Rational Java: Creating Web Services and a Rest Server with JAX-RX and Jetty.

Creating a WebService in Java is remarkably easy. To add it to a ServletContainer and deploy it to an embedded WebServer is only a few more lines of code.

Let’s create a simple calculator with a couple of functions as an example of a WebService. The calculator will compute the squareRoot and square of any number.  It will return a simple JSON response with the name of the action, the input and the output.

Creating Web Services and a Rest Server with JAX-RX and Jetty


via Rational Java: Creating Web Services and a Rest Server with JAX-RX and Jetty.

Creating a Web Service in Java is remarkably easy. To add it to a Servlet Container and deploy it to an embedded WebServer is only a few more lines of code.

Let’s create a simple calculator with a couple of functions as an example of a WebService. The calculator will compute the squareRoot and square of any number.  It will return a simple JSON response with the name of the action, the input and the output.