?? I don't understand your question. I beleive that tapestry-resteasy does this 
for me.

Could it be that since the tapestry-resteasy HttpServletRequestHandler is 
placed before:GZIP, tapestry has not yet initialized its RequestGlobals and 
thus the session information is not yet available where reasteasy handles its 
service methods?

M.


Am 25.10.2010 um 18:30 schrieb Josh Canfield:

>> 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
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to