How to use Sessions on DropWizard

Since 0.7.0 HttpSessions are supported.

So what to do? Two things.
On the Application class:

public void run(DemoConfiguration config, Environment environment)
throws ClassNotFoundException {

environment.servlets().setSessionHandler(new SessionHandler());

On the Resource class:

public DemoView getMain(@Context UriInfo info,
@Session HttpSession session,
@PathParam(“param1”) String param1){


Dropwizard with Sessions


Posted on January 31, 2015, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: