cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Cocoon Wiki] New: ResponseHeaderTransformer
Date Thu, 12 Aug 2004 12:00:46 GMT
   Date: 2004-08-12T05:00:46
   Editor: NicoVerwer <>
   Wiki: Cocoon Wiki
   Page: ResponseHeaderTransformer

   no comment

New Page:

==  ResponseHeaderTransformer ==
- TARGET-AUDIENCE: '''*beginner*''' advanced expert[[BR]]
- COCOON-RELEASES: 2.0.3, 2.0.4[[BR]]
- DOCUMENT-STATUS: '''*draft*''' reviewed released[[BR]]

This is a simple transformer that allows you to set HTTP response headers from the content
of the XML that flows through the pipeline.

Other ways to set response headers are:
 *  HttpHeaderAction, which takes headers from the sitemap:
  <map:act type="header">
    <map:parameter name="Cache-Control" value="no-cache" />
 *  From Flow, which takes the header from a Flowscript:
  cocoon.response.setHeader("Cache-Control", "no-cache")

The ResponseHeaderTransformer is different from either of these methods, because it takes
the header names and values from the XML that is processed by the pipeline.

'''Declaration in sitemap:'''

  <map:transformers default="xslt">
    <map:transformer name="response-headers" src="org.apache.cocoon.transformation.ResponseHeaderTransformer"/>

'''Usage in pipeline:'''

  <map:transform type="response-headers"/>

The transformer will look for elements in the ""

<header:set name="Cache-Control" value="no-cache"

These elements are removed from the XML, and the header (Cache-Control) is set (to "no-cache").

View raw message