8.2. Displaying Content Items with Templates

8.2.1. CMS Dispatch

The CMS dispatcher system dispatches a request for a content item directly to that content item's template JSP in order to minimize the CMS dispatcher's overhead. A content section in the CMS is an application. The CMS dispatcher consists of a number of systems that hand off application processing.

The Content Section servlet checks if the request is for a public, content-item. If so, it places the content item in the request and forwards the request to a new content-item dispatcher. If it isn't, then it will follow the existing chained-dispatcher path for determining if it is an admin or file or other request.

The content-item dispatcher maintains a table mapping content-items to their template JSP locations. The dispatcher will look up the content-item's template JSP, set the CMSContext, and forward the request to the JSP. Once the template JSP receives the request, it takes the content item and uses it to create a document. Then, it transforms the document and writes this out to the servlet response.

8.2.2. Templates

Custom templates for the CMS can be written in either XSLT or JSP. When using XSL templates for a content type, the XSL files should go in the file system, typically in web/static/content-types/com/arsdigita/cms/contenttypes/.