Skip to content

Instantly share code, notes, and snippets.

@nickfun
Created November 25, 2014 00:50
Show Gist options
  • Save nickfun/0612a97b934ba810e9f5 to your computer and use it in GitHub Desktop.
Save nickfun/0612a97b934ba810e9f5 to your computer and use it in GitHub Desktop.
Dropwizard cookie example
import javax.ws.rs.core.Response;
import javax.ws.rs.core.NewCookie;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
public class MyResource {
@GET
@Path("/")
public Response getPage() {
PageView myView = new PageView();
NewCookie myCookie = new NewCookie("username","test-user");
return Response.ok().entity(myView).cookie(myCookie).build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment