Below are the two common ways to configure [create] request handling pipeline servlets in ATG.
1. Extend atg.servlet.pipeline.PipelineableServletImpl.
2. Extend atg.servlet.pipeline.InsertableServletImpl.
1. Extend atg.servlet.pipeline.PipelineableServletImpl
Follow below steps to configure servlet using PipelineableServletImpl.
- Extend atg.servlet.pipeline.PipelineableServletImpl.
- Define the servlet as a globally scoped Nucleus component.
- Reset the previous servlet’s nextServlet property to point to the new servlet.
- Set the new servlet’s nextServlet property to point to the next servlet in the pipeline.
- Add the servlet’s path to the initialServices property of /atg/dynamo/servlet/Initial.
2. Extend atg.servlet.pipeline.InsertableServletImpl
Follow below steps to configure servlet using InsertableServletImpl.
- Extend atg.servlet.pipeline.InsertableServletImpl.
- Define the servlet as a globally scoped Nucleus component.
- Set the insertAfterServlet property of your servlet to point to the path of the pipeline servlet you want your servlet to follow.
For example, you can insert a servlet after StoreServlet as follows :
insertAfterServlet=/atg/dynamo/servlet/dafpipeline/StoreServlet - Add the servlet’s path to the initialServices property of /atg/dynamo/servlet/Initial
Advantage of second approach is you no need to make any change in the existing servlets.
No comments:
Post a Comment