jsr340-experts@servlet-spec.java.net

[jsr340-experts] Re: Support of Interceptor in Servlet

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Wed, 08 Feb 2012 08:50:16 -0800

On 2/7/12 11:40 PM, Remy Maucherat wrote:
> On Tue, 2012-02-07 at 15:45 -0800, Rajiv Mordani wrote:
>> The platform spec is planning on introducing transactional interceptors
>> which would
>> enable container managed transactions for containers that supported it.
>> As pointed out
>> by Linda in the mail that Shing Wai has a pointer to in the original
>> email. It would be a
>> way to unify the container managed transaction feature across the
>> platform and I
>> think it is a useful feature to have in the web container.
> Hum, yes, I get that the two uses for all this syntaxic sugar is some TX
> and some log. So log is useless because it doesn't have access to the
> HTTP information, and I don't see what the benefit of marking a servlet
> transactional either since it is not supposed to be a business
> component.
>
The log example is only for illustration on how interceptor and
interceptor binding are used.
If one put the interceptor binding on Servlet#service method, then one
can access the
request and response object through InvocationContext#getParameters.

The main question is whether we want to support interceptors in Servlet.

Shing Wai Chan