Package org.apache.rave.rest.model

Examples of org.apache.rave.rest.model.RestEntity


    public void filter(ContainerRequestContext containerRequestContext, ContainerResponseContext containerResponseContext) throws IOException {
        String method = containerRequestContext.getRequest().getMethod();

        if (method.equals("POST") && containerResponseContext.getStatus() == Response.Status.OK.getStatusCode()) {
            containerResponseContext.setStatus(Response.Status.CREATED.getStatusCode());
            RestEntity entity = (RestEntity) containerResponseContext.getEntity();
            String id = entity.getId();
            containerResponseContext.getHeaders().add("Location",
                    containerRequestContext.getUriInfo().getAbsolutePathBuilder().path(id).build().toString());
        }

        //containerResponseContext.getHeaders().put("Location")
View Full Code Here

TOP

Related Classes of org.apache.rave.rest.model.RestEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.