Create a component. Place it around everything else in the tree. In your component's encodeBegin(), write:
ResponseWriter oldWriter = context.getResponseWriter(); // You almost always want to at least partially delegate ResponseWriter myWriter = new MyWriter(oldWriter); context.setResponseWriter(myWriter); and in encodeEnd(): MyWriter writer = (MyWriter) context.getResponseWriter(); context.setResponseWriter(writer.getOldResponseWriter()); -- Adam On 5/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Adam sorry for my response vague…. What I need is that the method getResponseWriter of FacesContext return a my implementation of ResponseWriter. I there any way to configure my implementation of ResponseWriter? Thanks in advance Mario ________________________________ From: Adam Winer [mailto:[EMAIL PROTECTED] Sent: 22 maggio 2007 00.40 To: MyFaces Discussion Subject: Re: How to override ResponseWriter That's awfully vague... At any rate, I'd consider inserting a custom component inside f:view but as a parent of everything else, and making that custom component install a decorating ResponseWriter. If you're using a Facelets template for your pages, that's easy enough. -- Adam On 5/21/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: I need to execute some code for all html renderers before default startElement. -----Original Message----- From: Adam Winer [mailto:[EMAIL PROTECTED] Sent: 21 maggio 2007 18.34 To: MyFaces Discussion Subject: Re: How to override ResponseWriter It'd help if you told us what you were trying to do, as there's more than one possible answer. -- Adam On 5/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > Hi, is there a way to override the default ResponseWriter? How can I > configure it? > > > > Thanks in advance > > Mario Buonopane > > > > > > > > > > > This message is for the designated recipient only and may contain > privileged, proprietary, or otherwise private information. If you have > received it in error, please notify the sender immediately and delete the > original. Any other use of the email by you is prohibited. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

