To add your own rule filter:

  1. Write the Rule Filter Class.

  2. 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:

ruleFilters=\
      RequestParameterRuleFilter,\
      MyCustomRuleFilter,\
      URLPatternMatchingRuleFilter

Copyright © 1997, 2014 Oracle and/or its affiliates. All rights reserved. Legal Notices