Monthly Archives: January 2015

How to use Sessions on DropWizard

Since 0.7.0 HttpSessions are supported.

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

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

environment.servlets().setSessionHandler(new SessionHandler());
environment.jersey().register(HttpSessionProvider.class);
}

On the Resource class:

@GET
@Path(“/sessiontest”)
@Timed
@UnitOfWork
@ExceptionMetered
public DemoView getMain(@Context UriInfo info,
@Session HttpSession session,
@PathParam(“param1”) String param1){


}

Dropwizard with Sessions

Advertisements

How to debug python script

I recently had problem with a python script to find out where the problem is i had to jump thru it line by line. Of course there are many ways to do this. I did it like this:

python -m pdb gsm_receive_rtl.py

l – l
n – next line

HowTo: Run wireshark on Mac Yosemite

To run wireshark on yosemite install wireshark as you world do normally. And than link the dir:
sudo ln -s /opt/X11 /usr/X11

after that it should work.