@@ -0,0 +1,1628 @@
+package com.padma.aem.core.sling.filter;%0A%0Aimport org.apache.felix.scr.annotations.Property;%0Aimport org.apache.felix.scr.annotations.Reference;%0Aimport org.apache.felix.scr.annotations.sling.SlingFilter;%0Aimport org.apache.sling.api.SlingHttpServletRequest;%0Aimport org.osgi.service.log.LogService;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport javax.servlet.*;%0Aimport java.io.IOException;%0A%0Aimport static org.apache.felix.scr.annotations.sling.SlingFilterScope.REQUEST;%0Aimport static org.osgi.service.log.LogService.LOG_INFO;%0A%0A%0A/**%0A * Created on 8/11/16.%0A */%0A@SlingFilter(order = 1, scope = REQUEST)%0A@Property(name = %22sling.filter.pattern%22, value = %22%22)%0Apublic class HelloWorldFilter implements Filter%0A%7B%0A%09private final Logger logger = LoggerFactory.getLogger(HelloWorldFilter.class);%0A%0A%09@Reference%0A%09private LogService logService;%0A%0A%09@Override%0A%09public void init(final FilterConfig filterConfig) throws ServletException%0A%09%7B%0A%09%09// do nothing%0A%09%7D%0A%0A%09@Override%0A%09public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain)%0A%09%09%09throws IOException, ServletException%0A%09%7B%0A%09%09try%0A%09%09%7B%0A%09%09%09filterChain.doFilter(servletRequest, servletResponse);%0A%09%09%7D%0A%09%09finally%0A%09%09%7B%0A%09%09%09final SlingHttpServletRequest slingRequest = (SlingHttpServletRequest) servletRequest;%0A%09%09%09logger.debug(%22request for %7B%7D, with selector %7B%7D%22, slingRequest.getRequestPathInfo().getResourcePath(),%0A%09%09%09%09%09slingRequest.getRequestPathInfo().getSelectorString());%0A%09%09%09logService.log(LOG_INFO, %22Handled sling request %22 + slingRequest.getPathInfo());%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public void destroy()%0A%09%7B%0A%09%09// do nothing%0A%09%7D%0A%7D%0A

add sling filter