Sling Filters Usage | Community
Skip to main content
Mani_kumar_
Community Advisor
Community Advisor
February 4, 2016
Solved

Sling Filters Usage

  • February 4, 2016
  • 3 replies
  • 1384 views

Hi All,

I want to know what is specific usage of the sling servlet filters can someone porvide any example in real world scenario.

 

Thanks,

Mani Kumar

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jitendra_S_Toma

Here is a good article on this topic.

"Sling filters are basically OSGi services which are implementing javax.servlet.Filter interface. They are mostly used for authentication of request, post processing of markup or adding/modifying some request parameters etc. Sling supports filters by applying filter chains to the requests before actually dispatching to the servlet or script for processing."

http://hashimkhan.in/aem-adobecq5-code-templates/filters/

Jitendra

korthivada wrote...

Hi All,

I want to know what is specific usage of the sling servlet filters can someone porvide any example in real world scenario.

 

Thanks,

Mani Kumar

 

3 replies

Jitendra_S_Toma
Jitendra_S_TomaAccepted solution
Level 10
February 4, 2016

Here is a good article on this topic.

"Sling filters are basically OSGi services which are implementing javax.servlet.Filter interface. They are mostly used for authentication of request, post processing of markup or adding/modifying some request parameters etc. Sling supports filters by applying filter chains to the requests before actually dispatching to the servlet or script for processing."

http://hashimkhan.in/aem-adobecq5-code-templates/filters/

Jitendra

korthivada wrote...

Hi All,

I want to know what is specific usage of the sling servlet filters can someone porvide any example in real world scenario.

 

Thanks,

Mani Kumar

 

Mani_kumar_
Community Advisor
Community Advisor
February 4, 2016

Thanks Jitendra can you provide any real time scenario example 

Jitendra_S_Toma
Level 10
February 4, 2016

 Let's suppose, you want to meet any govt officer and before meeting to him, you have to go through peon (big boss) and he will do the checks before granting permission to you. 

In similar fashion, any request comes to AEM system, go through these filters and these filters do the verification of the call.

Jitendra

korthivada wrote...

Hi All,

I want to know what is specific usage of the sling servlet filters can someone porvide any example in real world scenario.

 

Thanks,

Mani Kumar