示例#1
0
 /* Remote access to EJB */
 @GET
 @Path("/remote")
 public Response listIocsRemote() {
   return Response.status(Response.Status.OK)
       .header("Access-Control-Allow-Origin", "*")
       .header("Access-Control-Allow-Headers", "origin, content-type, accept, authorization")
       .header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD")
       .header("Access-Control-Max-Age", "1209600")
       .entity(remoteBean.showIOCs())
       .build();
 }
示例#2
0
 @DELETE
 @Path("/remote/delete/{id}")
 public Response deleteIocRemote(@PathParam("id") Integer id) {
   remoteBean.removeIOC(id);
   return Response.status(Response.Status.OK)
       .header("Access-Control-Allow-Origin", "*")
       .header("Access-Control-Allow-Headers", "origin, content-type, accept, authorization")
       .header("Access-Control-Allow-Credentials", "true")
       .header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD")
       .header("Access-Control-Max-Age", "1209600")
       .build();
 }
示例#3
0
 @POST
 @Path("/remote/add")
 public Response createIocRemote(IOC ioc) {
   remoteBean.addIOC(ioc);
   return Response.status(Response.Status.CREATED)
       .header("Access-Control-Allow-Origin", "*")
       .header("Access-Control-Allow-Headers", "origin, content-type, accept, authorization")
       .header("Access-Control-Allow-Credentials", "true")
       .header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD")
       .header("Access-Control-Max-Age", "1209600")
       .entity(ioc)
       .build();
 }