Mobile Programming - Lecture 14

Cover page image

Cay S. Horstmann

REST

JAX-RS

Hello, World!

import javax.ws.rs.*;
import javax.ws.rs.core.*;

@Path("/hello")
public class HelloService {
   @GET
   @Path("/{name}")
   public Response getText(@PathParam("name") String name) {
      String output = "Hello " + name + "\n";
      return Response.status(200).entity(output).build();
   }
}
  

Java EE for Elvis

Java EE Architecture

Java Persistence Architecture (JPA)

Entity Manager

???

Session Beans

Lab

Hello, World

Serving Questions

Producing XML and JSON

The Entities

Initializing the Data

Optional—Spying on the Database

Client Queries