ART#114 - What is Servlet Pipeline in ATG?

Back



Next



Every framework has a specific process to handle incoming requests. ATG is no different. For every incoming request, ATG calls a chain of servlets to process each request. This chain of servlets is called "Servlet Pipeline".

ATG has two types of servlet pipelines to handle different kinds of requests.
1. DAF Pipeline: For JSP requests

DAF Pipeline is a chain of servlets which is called when a JSP is requested.
Below is how a JSP request is handled in ATG:-

1. In the web.xml of the ATG application, all ".jsp" requests are mapped to a filter called "PageFilter". 

2. This filter internally invokes the DAF Servlet Pipeline.

3. The first servlet in DAF Servlet Pipeline is "DynamoHandler".

4. The main task of this servlet is to convert HttpServletRequest and HttpServletResponse objects to DynamoHttpServletRequest and DynamoHttpServletResponse objects.

5. HttpServletRequest and HttpServletResponse objects are immutable by default and do not have any setter methods. Conversion to DynamoHttpServletRequest and DynamoHttpServletResponse objects adds setter methods to original objects, hence making them mutable for ATG use.

6. The request runs through a lot of other servlet, and ends with TailPipelineServlet.

7. Each servlet in this pipeline implements InsertableServlet interface (or extends InsertableServletImpl class).

2. DAS Pipeline: For JHTML requests

DAS Pipeline is used to handle JHTML requests. JHTML pages are usually ATG's out of the pages accessible from dyn/admin (for example, pages to update inventory in dyn/admin).

This pipeline is invoked by DynamoProxyServlet, which calls a whole chain of other servlets.


Why DAF Pipeline starts with a filter and DAS Pipeline starts with a servlet?

Since DAF pipeline is supposed to handle JSP requests, JSPs can be compiled by application servers like JBoss, Tomcat, Weblogic etc. Therefore filter can be used to intercept the request.

However, DAS pipeline handles JHTML requests. Since application servers cannot compile JHTML pages (these pages are ATG specific), therefore ATG's own page compilation mechanism comes into play.


4 comments:

  1. Hello Monis,
    Can you give one example in details to understand DAS Pipeline?

    ReplyDelete
  2. Hey Monis,

    In the final paragraph of your article you have mentioned DAF pipeline handles JHTML requests? I hope this should altered to DAS instead of DAF..

    ReplyDelete
    Replies
    1. That was a typo and has been corrected. Thanks for pointing out.

      Delete

Subscribe

Get All The Latest Updates Delivered Straight Into Your Inbox For Free!

Flickr