You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Felix Meschberger <fm...@gmail.com> on 2010/09/07 15:49:45 UTC

[DISCUSS] Registering filters with Sling

Hi all,

Traditionally javax.servlet.Filter services were picked up by the Sling
Main Servlet and used as filters regardless of any service registration
properties. The filter.scope property could optionally be used to define
a scope for the filter (request or component before SLING-1213, now also
INCLUDE, FORWARD, and ERROR).

To not pick up filters destined for the Apache Felix Http Service
(registered with the "pattern" service property) we explicitly xclude those.

I would like to go a step further and ....

  * define a new service property sling.filter.scope
  * deprecate the old filter.scope property
  * require services to either have the sling.filter.scope or
    the filter.scope (backwards compatibility) property set
  * optionally: support for a configuration option to cause
    filters without a scope property to still be picked up

I consider renaming the official name to prevent any name collisions.

WDYT ?

Regards
Felix

Re: [DISCUSS] Registering filters with Sling

Posted by Justin Edelson <ju...@gmail.com>.
+1

On 9/7/10 9:49 AM, Felix Meschberger wrote:
> Hi all,
> 
> Traditionally javax.servlet.Filter services were picked up by the Sling
> Main Servlet and used as filters regardless of any service registration
> properties. The filter.scope property could optionally be used to define
> a scope for the filter (request or component before SLING-1213, now also
> INCLUDE, FORWARD, and ERROR).
> 
> To not pick up filters destined for the Apache Felix Http Service
> (registered with the "pattern" service property) we explicitly xclude those.
> 
> I would like to go a step further and ....
> 
>   * define a new service property sling.filter.scope
>   * deprecate the old filter.scope property
>   * require services to either have the sling.filter.scope or
>     the filter.scope (backwards compatibility) property set
>   * optionally: support for a configuration option to cause
>     filters without a scope property to still be picked up
> 
> I consider renaming the official name to prevent any name collisions.
> 
> WDYT ?
> 
> Regards
> Felix


Re: [DISCUSS] Registering filters with Sling

Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger  wrote
> The order property has already been deprecated in favor of the OSGi
> standard service.ranking property (as of FELIX-1213).
>
Perfect :)

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: [DISCUSS] Registering filters with Sling

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 07.09.2010 16:07, Carsten Ziegeler wrote:
> Ian Boston  wrote
>>
>> On 7 Sep 2010, at 14:49, Felix Meschberger wrote:
>>
>>> Hi all,
>>>
>>> Traditionally javax.servlet.Filter services were picked up by the Sling
>>> Main Servlet and used as filters regardless of any service registration
>>> properties. The filter.scope property could optionally be used to define
>>> a scope for the filter (request or component before SLING-1213, now also
>>> INCLUDE, FORWARD, and ERROR).
>>>
>>> To not pick up filters destined for the Apache Felix Http Service
>>> (registered with the "pattern" service property) we explicitly xclude those.
>>>
>>> I would like to go a step further and ....
>>>
>>>  * define a new service property sling.filter.scope
>>>  * deprecate the old filter.scope property
>>>  * require services to either have the sling.filter.scope or
>>>    the filter.scope (backwards compatibility) property set
>>>  * optionally: support for a configuration option to cause
>>>    filters without a scope property to still be picked up
>>>
>>> I consider renaming the official name to prevent any name collisions.
>>>
>>> WDYT ?
>>
>> Yes, makes sense to me.
>> Might reqiure some patches for those downstream but it will be minor, and will generate a better distinction between Sling filters and httpservice filters.
>>
> Sounds ok to me, but if we rename the scope prop we should rename the
> order prop as well to avoid collisions.

The order property has already been deprecated in favor of the OSGi
standard service.ranking property (as of FELIX-1213).

Regards
Felix

Re: [DISCUSS] Registering filters with Sling

Posted by Carsten Ziegeler <cz...@apache.org>.
Ian Boston  wrote
> 
> On 7 Sep 2010, at 14:49, Felix Meschberger wrote:
> 
>> Hi all,
>>
>> Traditionally javax.servlet.Filter services were picked up by the Sling
>> Main Servlet and used as filters regardless of any service registration
>> properties. The filter.scope property could optionally be used to define
>> a scope for the filter (request or component before SLING-1213, now also
>> INCLUDE, FORWARD, and ERROR).
>>
>> To not pick up filters destined for the Apache Felix Http Service
>> (registered with the "pattern" service property) we explicitly xclude those.
>>
>> I would like to go a step further and ....
>>
>>  * define a new service property sling.filter.scope
>>  * deprecate the old filter.scope property
>>  * require services to either have the sling.filter.scope or
>>    the filter.scope (backwards compatibility) property set
>>  * optionally: support for a configuration option to cause
>>    filters without a scope property to still be picked up
>>
>> I consider renaming the official name to prevent any name collisions.
>>
>> WDYT ?
> 
> Yes, makes sense to me.
> Might reqiure some patches for those downstream but it will be minor, and will generate a better distinction between Sling filters and httpservice filters.
> 
Sounds ok to me, but if we rename the scope prop we should rename the
order prop as well to avoid collisions.

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: [DISCUSS] Registering filters with Sling

Posted by Ian Boston <ie...@tfd.co.uk>.
On 7 Sep 2010, at 14:49, Felix Meschberger wrote:

> Hi all,
> 
> Traditionally javax.servlet.Filter services were picked up by the Sling
> Main Servlet and used as filters regardless of any service registration
> properties. The filter.scope property could optionally be used to define
> a scope for the filter (request or component before SLING-1213, now also
> INCLUDE, FORWARD, and ERROR).
> 
> To not pick up filters destined for the Apache Felix Http Service
> (registered with the "pattern" service property) we explicitly xclude those.
> 
> I would like to go a step further and ....
> 
>  * define a new service property sling.filter.scope
>  * deprecate the old filter.scope property
>  * require services to either have the sling.filter.scope or
>    the filter.scope (backwards compatibility) property set
>  * optionally: support for a configuration option to cause
>    filters without a scope property to still be picked up
> 
> I consider renaming the official name to prevent any name collisions.
> 
> WDYT ?

Yes, makes sense to me.
Might reqiure some patches for those downstream but it will be minor, and will generate a better distinction between Sling filters and httpservice filters.

Ian

> 
> Regards
> Felix


RE: [DISCUSS] Registering filters with Sling

Posted by Mike Müller <mi...@mysign.ch>.
+1

much more clear than the status quo.

best regards
mike

> -----Original Message-----
> From: Felix Meschberger [mailto:fmeschbe@gmail.com]
> Sent: Tuesday, September 07, 2010 3:50 PM
> To: Sling Developers
> Subject: [DISCUSS] Registering filters with Sling
> 
> Hi all,
> 
> Traditionally javax.servlet.Filter services were picked up by the Sling
> Main Servlet and used as filters regardless of any service registration
> properties. The filter.scope property could optionally be used to define
> a scope for the filter (request or component before SLING-1213, now also
> INCLUDE, FORWARD, and ERROR).
> 
> To not pick up filters destined for the Apache Felix Http Service
> (registered with the "pattern" service property) we explicitly xclude those.
> 
> I would like to go a step further and ....
> 
>   * define a new service property sling.filter.scope
>   * deprecate the old filter.scope property
>   * require services to either have the sling.filter.scope or
>     the filter.scope (backwards compatibility) property set
>   * optionally: support for a configuration option to cause
>     filters without a scope property to still be picked up
> 
> I consider renaming the official name to prevent any name collisions.
> 
> WDYT ?
> 
> Regards
> Felix

Re: [DISCUSS] Registering filters with Sling

Posted by Felix Meschberger <fm...@gmail.com>.
Hi all,

Thanks for the feedback so far. I have created SLING-1734 [1] to track
this change.

Regards
Felix

[1] https://issues.apache.org/jira/browse/SLING-1734

On 07.09.2010 15:49, Felix Meschberger wrote:
> Hi all,
> 
> Traditionally javax.servlet.Filter services were picked up by the Sling
> Main Servlet and used as filters regardless of any service registration
> properties. The filter.scope property could optionally be used to define
> a scope for the filter (request or component before SLING-1213, now also
> INCLUDE, FORWARD, and ERROR).
> 
> To not pick up filters destined for the Apache Felix Http Service
> (registered with the "pattern" service property) we explicitly xclude those.
> 
> I would like to go a step further and ....
> 
>   * define a new service property sling.filter.scope
>   * deprecate the old filter.scope property
>   * require services to either have the sling.filter.scope or
>     the filter.scope (backwards compatibility) property set
>   * optionally: support for a configuration option to cause
>     filters without a scope property to still be picked up
> 
> I consider renaming the official name to prevent any name collisions.
> 
> WDYT ?
> 
> Regards
> Felix