Charset puzzled me too.
I add Chinese resources file.
But cannot show properly.

I have tried:
1.add org.springframework.web.filter.CharacterEncodingFilter, doesn't work;

2.native2ascii resource files, doesn't work;

3.add
       configuration.add("tapestry.supported-locales", "en,zh");

doesn't work;

4.
   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();
                }
            };
        }

doesn't work;

Is there a proposal method?




On Dec 30, 2007 9:56 PM, yuan gogo <[EMAIL PROTECTED]> wrote:

> Thanks for answering.
>
> But I DID add this into my AppModule,  but the problem is still there.
> I finanlly solved this by using Spring charset encoding filter.
>
>
>
> 2007/12/29, Michael Lake <[EMAIL PROTECTED]>:
> >
> >
> > I'm also having this issue and i'm not even chinese.I did find this
> > though:
> >
> > http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding
> >
> > i'll give it a shot with 5.0.8-SNAPSHOT though
> >
> > On Dec 28, 2007, at 11:03 AM, Howard Lewis Ship wrote:
> >
> > > Thanks, will look into this.
> > >
> > > On Dec 27, 2007 6:59 PM, yuan gogo <[EMAIL PROTECTED]> wrote:
> > >> I got t5.0.7 this morning. As I'm a Chinese user, I use utf-8
> > >> encoding for
> > >> my application.
> > >>
> > >> But, while upload file and some text, I got this:
> > >>
> > >> java.lang.NullPointerException: charsetName
> > >>
> > >>        java.lang.String.<init>(String.java:442)
> > >>        java.lang.String.<init>(String.java:516)
> > >>
> > >> org
> > >> .apache
> > >> .commons.fileupload.disk.DiskFileItem.getString(DiskFileItem.java:
> > >> 349)
> > >>
> > >> org
> > >> .apache
> > >> .tapestry
> > >> .upload
> > >> .services
> > >> .MultipartDecoderImpl.processFileItems(MultipartDecoderImpl.java:117)
> > >>
> > >> org
> > >> .apache
> > >> .tapestry
> > >> .upload
> > >> .services.MultipartDecoderImpl.decode(MultipartDecoderImpl.java:65)
> > >>
> > >> $
> > >> MultipartDecoder_1171ead916b
> > >> .decode($MultipartDecoder_1171ead916b.java)
> > >>
> > >> $
> > >> MultipartDecoder_1171ead911d
> > >> .decode($MultipartDecoder_1171ead911d.java)
> > >>
> > >> org
> > >> .apache
> > >> .tapestry
> > >> .upload
> > >> .services
> > >> .MultipartServletRequestFilter
> > >> .service(MultipartServletRequestFilter.java:40)
> > >>
> > >> $
> > >> HttpServletRequestHandler_1171ead911f
> > >> .service($HttpServletRequestHandler_1171ead911f.java)
> > >>
> > >> $
> > >> HttpServletRequestHandler_1171ead911c
> > >> .service($HttpServletRequestHandler_1171ead911c.java)
> > >>
> > >> org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:164)
> > >>
> > >>
> > >> Alrough I solve this problem by add
> > >>    <filter>
> > >>        <filter-name>SetCharacterEncoding</filter-name>
> > >>        <filter-class>
> > org.springframework.web.filter.CharacterEncodingFilter
> > >> </filter-class>
> > >>        <init-param>
> > >>            <param-name>encoding</param-name>
> > >>            <param-value>utf-8</param-value>
> > >>        </init-param>
> > >>    </filter>
> > >>    <filter-mapping>
> > >>        <filter-name>SetCharacterEncoding</filter-name>
> > >>        <url-pattern>/*</url-pattern>
> > >>    </filter-mapping>
> > >>
> > >> in my web.xml.
> > >>
> > >> But I hope this can be handled by tapestry. And a NULL check for
> > >> charset
> > >> name is necessary.
> > >>
> > >> Thank you all !
> > >>
> > >
> > >
> > >
> > > --
> > > Howard M. Lewis Ship
> > >
> > > Creator Apache Tapestry and Apache HiveMind
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>



-- 
Korben Zhang
Blog: http://korben-zhang.blogspot.com | http://korbenzh.spaces.live.com

Reply via email to