Created
November 25, 2014 00:50
-
-
Save nickfun/0612a97b934ba810e9f5 to your computer and use it in GitHub Desktop.
Dropwizard cookie example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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