On Jun 12, 2009, at 12:00 AM, Igor Minar wrote:
>
> On Jun 11, 2009, at 5:46 AM, Paul Sandoz wrote:
>
>>
>> On Jun 11, 2009, at 2:29 PM, Igor Minar wrote:
>>
>>> Hi there,
>>>
>>> I'm curious as to why it is illegal to inject request as a method
>>> parameter for methods annotated with @GET.
>>>
>>
>> You can do this:
>>
>> @GET
>> public String get(@Context HttpServletRequest hsr) {
>> String remoteAddress = hsr.getRemoteAddr();
>> }
>>
>
> That's what I tried, but I'm getting an error that such a method is
> an illegal/invalid method for given http method. I'm using 1.1.0-ea.
>
I cannot reproduce, It works for me.
Can you send the log/stack trace (if any) ?
Can you inject "@Context HttpServletRequest hsr" as a field of the
class instead?
Are you deploying using a Web container?
Paul.