Thank you Nick!
and I set <?xml version="1.0" encoding="UTF-8"?> in the *.html file。

2007/4/16, Nick Westgate <[EMAIL PROTECTED]>:
> /*contributing a HttpServletRequestFilter  */
...
> doesn't work!
> Maybe something wrong!

I didn't check to see why it doesn't work, but I've been
looking into this issue too - for displaying Japanese.

The HttpServletRequestFilter approach is not the best way
to go about this, because it handles _all_ requests given
to Tapestry - we want to only alter page rendering ...

> Can anyone tell me a complete solution?

Yes! :-) Or at least, I think so. This solution was in a
Japanese Tapestry forum, and digging through the Tapestry
source code I think it's the best way - at least for now.

Just add this to your AppModule:

    public static PageResponseRenderer decoratePageResponseRenderer(
        @InjectService("PageMarkupRenderer")
        final PageMarkupRenderer markupRenderer,
        @InjectService("MarkupWriterFactory")
        final MarkupWriterFactory markupWriterFactory, final Object delegate)
    {

        return new PageResponseRenderer()
        {
            public void renderPageResponse(Page page, Response response) throws 
IOException
            {
                MarkupWriter writer = markupWriterFactory.newMarkupWriter();
                markupRenderer.renderPageMarkup(page, writer);
                PrintWriter pw = response.getPrintWriter("text/html; 
charset=UTF-8");
                writer.toMarkup(pw);
                pw.flush();
            }
        };
    }

Cheers,
Nick.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Chinese name:徐 依伟
English name: will

Reply via email to