You are right, the Request is not yet available. The RESTEasy filter
is a HttpServletRequestFilter not a RequestFilter, so you need to
inject the HttpServletRequest to make it work.
Try this:

        @Inject
        private HttpServletRequest request;

BTW, remember that sessions should be irrelevant in a REST environment.

Saludos.
Alejandro.


On Mon, Oct 25, 2010 at 9:36 PM, Josh Canfield <joshcanfi...@gmail.com> wrote:
>> ?? I don't understand your question. I beleive that tapestry-resteasy does 
>> this for me.
> Hm. RESTEasy is a jboss project, I assumed you were rolling your own
> tapestry integration since you didn't mention anything about using a
> third party library for doing that integration.
>
>> 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?
>
> I don't use tynamo so I don't know what they are doing, but I'd guess
> that something like you've suggested is the culprit.
>
> Josh
>
>
> On Mon, Oct 25, 2010 at 12:15 PM, Moritz Gmelin <moritz.gme...@gmx.de> wrote:
>> ?? 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
>>
>>
>
> ---------------------------------------------------------------------
> 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