Hi David, You might start by looking at the standard transforms that come with mav--DocumentTransform and XSLTransform. You might also look into opt-fop. Since you are not actually transforming the content, it should be pretty simple. Your transforms get the HttpServletResponse as part of the TransformContext, so that is where you will write the headers. After writing the headers, all you need to do is pass the input you received on to the next Transform (even if you are last in the chain, Maverick has an internal final transform, so you still need to do this)--I would probably do this by overriding StringTransformStep.
I've written a couple transforms myself (opt-fop and opt-perl) so if you have any more specific questions, just ask. --jim ----- Original Message ----- From: "David Cuthill" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 30, 2002 4:30 AM Subject: RE: [Mav-user] Requirement: Setting HTTP headers Thanks Jim I had considered the easiest route of writing the headers from the controllers, but not every page needs these headers set, thus, I would need specific controllers for these pages, even if an existing controller exists. This felt awkward. I'll take a look into your idea of a 'custom "header setting" transform' - does any of the example code or optional packages source demonstrate this? Cheers David -----Original Message----- From: jim moore [mailto:[EMAIL PROTECTED]] Sent: 29 September 2002 04:45 To: [EMAIL PROTECTED] Subject: RE: [Mav-user] Requirement: Setting HTTP headers The ControllerContext has the HttpResponse in it, so by far the easiest thing to do would be to simply write these headers to the response in your controller. Alternately, you could modify the views you use to take parameters to set headers, or define a custom "header setting" transform that you could put last in the transform chain. --jim -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of David Cuthill Sent: Friday, September 27, 2002 4:31 AM To: [EMAIL PROTECTED] Subject: [Mav-user] Requirement: Setting HTTP headers Hi all, I'm a recent convert to Mav which I am very impressed with. I have a requirement to be able to write specific HTTP headers (Cache-Control, Pragma & Expires). I cannot see how to do this in Mav at present, but with a pointer in the right direction I can try to add this feature to Mav for my current project. Presumably, It would be best achieved in the 'view' phase and envisage the maverick.xml file containing something like: <command name="foo"> <controller class="ctl.foo"/> <view name="success" ref="bar"> <meta cache-control="no-store" pragma="no-cache" Expires="0"/> </view> </command> Any thoughts & guidance appreciated. -DavidC ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf [INVALID FOOTER] ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf [INVALID FOOTER] ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf [INVALID FOOTER] ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf [INVALID FOOTER]
