JAX-RS - ResourceContext Examples

Code Snippets JAX-RS JAVA EE 

package com.logicbig.example;

import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.container.ResourceContext;
import javax.ws.rs.core.Context;

@Path("/")
public class OrderResource {

@Context
private ResourceContext resourceContext;

@Path("/orders/{id}")
public OrderDetails getOrderById(@PathParam("id") int orderId) {
return resourceContext.initResource(new OrderDetails(orderId));
}
}
Original Post




See Also