users@grizzly.java.net

Re: Grizzly 2.x and Basic auth. and Filters

From: Sumit Aneja <sumitaneja_at_msn.com>
Date: Tue, 21 Jun 2016 23:08:34 -0700 (MST)

Hi Ryan,
Actually i was looking for solution that can work on all valid(mapping to
servlet/Httphandler/Rest resource) Inbound http request.

But if i go with servletfilters, i wont be able to apply those to
HttpHandler.



What you said can be applicable only for
Ryan Lubke-2 wrote
> If you want to implement something portable that doesn't rely on Grizzly
> directly, then I would really recommend using the Servlet support
> offered by Grizzly instead of the HTTP framework. There you can use
> Servlets and Servlet Filters (which is really what you're wanting).
>
>> Sumit Aneja &lt;mailto:

> sumitaneja@

> &gt;
>> June 21, 2016 at 02:55
>> Thanks for response for Alexey. Actually i was looking for generic filter
>> which can be applied to all valid http requests.
>>
>> Custom HttpHandler would mean asking consumers to re-write there handler.
>>
>> And using attribute is again something propriety. Is there any alternate
>> approach which can be generic enough to implement.
>>
>> I saw that in HttpHandler grizzly handovers request to
>> workerthreadpool. At
>> that time subject set is not being transferred to new thread. To me This
>> seems bug with grizzly. Just a thought if i can use custom executor
>> implementation which has capability to set subject in execution
>> context. Do
>> you know if this is possible, if yes how.
>>
>>
>> Also What are your thoughts on second problem, i.e only valid requests
>> for
>> which a valid handler/servlet mapping exists, should this filter be
>> executed. Is there a generic way to do that. From my understanding
>> mapping
>> of requests to handlers/servlets happens in httpHandlerChain , but
>> filter is
>> executed before that.
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://grizzly.1045725.n5.nabble.com/Grizzly-2-x-and-Basic-auth-and-Filters-tp4770236p5711048.html
>> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>> Sumit Aneja &lt;mailto:

> sumitaneja@

> &gt;
>> June 17, 2016 at 03:44
>> Also how to propagate created subject
>>
>>
>>
>> --
>> View this message in context:
>> http://grizzly.1045725.n5.nabble.com/Grizzly-2-x-and-Basic-auth-and-Filters-tp4770236p5711043.html
>> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>> Sumit Aneja &lt;mailto:

> sumitaneja@

> &gt;
>> June 17, 2016 at 02:21
>> Hi Alexy,
>> Had similar problem one question though request to handler mapping
>> happens
>> in handlerchain.
>> If there is no mapping handler(404 scenario) how can i ensure my filter
>> doesn't run.
>>
>>
>>
>> --
>> View this message in context:
>> http://grizzly.1045725.n5.nabble.com/Grizzly-2-x-and-Basic-auth-and-Filters-tp4770236p5711042.html
>> Sent from the Grizzly - Users mailing list archive at Nabble.com.





--
View this message in context: http://grizzly.1045725.n5.nabble.com/Grizzly-2-x-and-Basic-auth-and-Filters-tp4770236p5711050.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.