You can reroute the servlet pipeline to include your own servlets that extend the atg.servlet.pipeline.PipelineableServletImpl class. This class implements all Servlet methods, so all you need to do is override the service method. This class defines a property called nextServlet of type Servlet, which specifies the next servlet in the pipeline. When your servlet finishes processing, it passes the request and response objects to the servlet specified by this property, by invoking a method called passRequest.
The following is an example of a pipeline servlet that prints the request URI before passing the request on to the next servlet in the pipeline:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import atg.servlet.*;
import atg.servlet.pipeline.*;
public class URIPrinter extends PipelineableServletImpl {
  public URIPrinter () {}
  public void service (DynamoHttpServletRequest request,
                       DynamoHttpServletResponse response)
       throws IOException, ServletException
  {
    System.out.println ("Handling request for " +
                        request.getRequestURI ());
    passRequest (request, response);
  }
}If you want to try out this servlet, you can insert it into the Dynamo request-handling mechanism:
- Compile your servlet as - URIPrinter.java.
- Create a component as an instance of the - URIPrinterclass. For convenience, put this component in the configuration tree at- /atg/dynamo/servlet/pipeline/URIPrinter.
- Modify the DAF servlet pipeline to insert your - URIPrinterbetween the- DynamoHandlerand- TransactionServletcomponents. The head of the DAF servlet pipeline is the service called- /atg/dynamo/servlet/pipeline/DynamoHandler. The default value of- DynamoHandler’s- nextServletproperty is- TransactionServlet, meaning that the- DynamoHandlerpasses its requests to the- TransactionServlet.- Change the - DynamoHandler’s- nextServletproperty to point to your- URIPrinter.
- Set your - URIPrinter’s- nextServletproperty to the- TransactionServlet.
Now when you run Dynamo, it prints out a message for each request before the request is handled by the remaining servlets.

