Add the Rule Filter to the SiteContextPipelineServlet.
Write the Rule Filter Class
A custom rule filter class implements the SiteContextRuleFilter interface and its filter()
method, which analyzes the request and returns the site ID. The filter()
method has this signature:
public String filter(DynamoHttpServletRequest pRequest,
SiteSessionManager pSiteSessionManager)
Add the Rule Filter
Rule filters are managed by the SiteContextPipelineServlet. The servlet’s ruleFilters
property specifies the installed rule filters and their order of execution:
$class=atg.multisite.SiteContextPipelineServlet $scope=global siteContextManager=SiteContextManager ruleFilters=\ RequestParameterRuleFilter,\ URLPatternMatchingRuleFilter insertAfterServlet=/atg/dynamo/servlet/dafpipeline/DynamoHandler
If you use standard += notation to add your rule filter, it executes only after the installed rule filters. If any of these filters returns a site ID, your custom filter might not execute.
You can use Nucleus configuration to modify this behavior in two ways:
Disable any installed rule filter that might preempt execution of custom rule filters by setting its
enabled
property tofalse
.Override the SiteContextPipelineServlet’s
ruleFilters
property and set the execution order of installed and custom filters as desired.For example:
ruleFilters=\ RequestParameterRuleFilter,\ MyCustomRuleFilter,\ URLPatternMatchingRuleFilter