> I'd like to get access to the current session from inside my resteasy handler > methods. How are you creating your resteasy handler?
On Mon, Oct 25, 2010 at 3:06 AM, Moritz Gmelin <moritz.gme...@gmx.de> wrote: > Hi, > > I'd like to get access to the current session from inside my resteasy handler > methods. But when I inject the request and call getSession() on it, I get a > NullPointerException. > My original goal was to get access to SessionState objects from tapestry by > calling the ApplicationStateManager.get() method with our SessionState > object. But this fails for the same reason. > Why is the session object not accessible from the injected Request object in > a ResteasyHandler? > > The code below will throw an exception on the line request.getSession(false). > > @Path("/resttest") > public class TestResource > { > > �...@inject > private Request request; > > �...@inject > private ApplicationStateManager asm; > > �...@injectresource > private Logger log; > > > �...@get > �...@produces("text/xml") > public List<TestEntity> getEntityList() > { > > log.warn("REST Request in request " + request); > log.warn("REST Request in session2 " + > request.getSession(false)); > > > M. > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org