Sling Servlet Filter
All,
I have a use case where I need to implement a custom feature in asset share search page.
Use case : I need to apply search filtering at page loading, if I have a suffix in the URL, for example : en/mediacenter.html/Image/Rolex => filter assets with a tag : Rolex.
The solution I figured out, is to implement a Sling servlet filter, to intercept the request, if I have the suffix then I create a predicate and call the search model otherwise do nothing and proceed with normal processing.
I have two questions :
- what do you think about this solution ? do you have better suggestions ?
- I stated implementing a sling servlet filter, but my request is never intercepted by my filter.
Here is my code snippet :
@8220494
@SlingServletFilter(
scope = {SlingServletFilterScope.REQUEST},
resourceTypes = {BrandFilterServlet.RESOURCE_TYPE},
pattern = "content/assetshare/.*",
extensions = {"html"},
methods = {"GET"})
public class BrandFilterServlet implements Filter {
public static final String RESOURCE_TYPE = "asset-share-commons/components/structure/search-page";
private static final Logger log = LoggerFactory.getLogger(RequestLogger.class.getName());
Any help please ?

