not sure what else to tell you then.  it looks like all your settings
are right and those settings work for others, so maybe your settings
aren't getting picked up somehow.

the one other thing you might check, is whether response.getWriter()
or getOutputStream() are being called somewhere before the
setContentType() method is being called.  according to the servlet api
docs, setContentType() must happen first.  given what you've shown us
of your code so far, it seems unlikely that this is happening, but i'm
fresh out of other ideas for you at this point.

perhaps you can play around with the encoding of the VelocityStruts
example apps and compare those to your own in order to narrow down
where the problem is.

On 11/7/05, Pham Anh Tuan <[EMAIL PROTECTED]> wrote:
> Thank you Nathan, after I did follow your instructs, it's still not work
> :( ...
>
> yes, I user Struts Framework, and in use something like below:
>
> in web.xml
>  <!-- Filter to set character encoding on each request -->
>  <filter>
>   <filter-name>Set Character Encoding</filter-name>
>   <filter-class>filters.SetCharacterEncodingFilter</filter-class>
>   <init-param>
>    <param-name>encoding</param-name>
>    <param-value>UTF-8</param-value>
>   </init-param>
>  </filter>
>
>  <!-- Define filter mappings for the defined filters -->
>  <filter-mapping>
>   <filter-name>Set Character Encoding</filter-name>
>   <servlet-name>action</servlet-name>
>  </filter-mapping>
>
> before I posted this problem, I had tested the case in which above filter
> (SetCharacterEncodingFilter) is erased, but, it's still not work, I mean the
> content is showed incorrectly.
>
> :(
>
>
> *************************************************
> Pham Anh Tuan
> Java Developer, HR Assistant
> ICHI Corporation Vietnam.
> Room #1001, 37 Ton Duc Thang, Dist. 1
> Ho Chi Minh City, Vietnam.
> Phone: (+84) (08) 9105732
> Fax: (+84) (08) 9105734
> Cell: (+84) (0) 989 505897
> Email: [EMAIL PROTECTED]
> Website: http://www.ichi-corp.jp
> *************************************************
> ----- Original Message -----
> From: "Nathan Bubna" <[EMAIL PROTECTED]>
> To: "Velocity Users List" <velocity-user@jakarta.apache.org>
> Sent: Tuesday, November 08, 2005 2:12 PM
> Subject: Re: [HELP] browser counldn't recognize charset=UTF-8 in meta tag :(
>
>
> > try setting a full "default.contentType" property in your
> > velocity.properties.  something like
> >
> > default.contentType = text/html; charset=UTF-8
> >
> > also, is there anything setting the content type on the
> > HttpServletResponse before/during/after the VelocityViewServlet gets
> > it?
> >
> > On 11/7/05, Pham Anh Tuan <[EMAIL PROTECTED]> wrote:
> >> Set encoding in velocity properties file:
> >> #----------------------------------------------------------------------------
> >> # T E M P L A T E  E N C O D I N G
> >> #----------------------------------------------------------------------------
> >>
> >> input.encoding=UTF-8
> >> output.encoding=UTF-8
> >>
> >> -----------------------------------------------
> >> my .properties file (encoded UTF-8)
> >> hello=tưởng chừng
> >>
> >> -----------------------------------------------------
> >> my .vm file
> >> <html>
> >> <head>
> >> <meta http-equiv="content-type" content="text/html; charset=utf-8">
> >> </head>
> >> <body>
> >> $test.hello
> >> </body>
> >> </html>
> >> ------------------------------------------------------
> >> what happened, plz help me :(
> >>
> >> *************************************************
> >> Pham Anh Tuan
> >> Java Developer, HR Assistant
> >> ICHI Corporation Vietnam.
> >> Room #1001, 37 Ton Duc Thang, Dist. 1
> >> Ho Chi Minh City, Vietnam.
> >> Phone: (+84) (08) 9105732
> >> Fax: (+84) (08) 9105734
> >> Cell: (+84) (0) 989 505897
> >> Email: [EMAIL PROTECTED]
> >> Website: http://www.ichi-corp.jp
> >> *************************************************
> >> ----- Original Message -----
> >> From: "Pham Anh Tuan" <[EMAIL PROTECTED]>
> >> To: "Velocity Users List" <velocity-user@jakarta.apache.org>
> >> Sent: Tuesday, November 08, 2005 1:30 PM
> >> Subject: Re: [HELP] browser counldn't recognize charset=UTF-8 in meta tag
> >> :(
> >>
> >>
> >> > thanks to Malcolm, but ... :( ...
> >> >
> >> > When I do the way you instruct, my browser is automatically change
> >> > encoding to UTF-8, but, my properties's content is showed incorrectly.
> >> > I
> >> > mean, before I change encoding in velocity property file, everytime I
> >> > view
> >> > 1 .vm file and I want to view page's content correctly, I must change
> >> > the
> >> > encode of that page by click on View\Encoding\UTF-8, after that, page's
> >> > content is viewed correctly. But after I do the way you show me, the
> >> > browser automatically change encode to UTF-8, but ... content is showed
> >> > correctly :( ...
> >> >
> >> > I don't know what wrong, my properties file (whose content is encoded
> >> > in
> >> > UTF-8) :( ..
> >> >
> >> >
> >> > *************************************************
> >> > Pham Anh Tuan
> >> > Java Developer, HR Assistant
> >> > ICHI Corporation Vietnam.
> >> > Room #1001, 37 Ton Duc Thang, Dist. 1
> >> > Ho Chi Minh City, Vietnam.
> >> > Phone: (+84) (08) 9105732
> >> > Fax: (+84) (08) 9105734
> >> > Cell: (+84) (0) 989 505897
> >> > Email: [EMAIL PROTECTED]
> >> > Website: http://www.ichi-corp.jp
> >> > *************************************************
> >> > ----- Original Message -----
> >> > From: "Malcolm Edgar" <[EMAIL PROTECTED]>
> >> > To: "Velocity Users List" <velocity-user@jakarta.apache.org>
> >> > Sent: Tuesday, November 08, 2005 11:51 AM
> >> > Subject: Re: [HELP] browser counldn't recognize charset=UTF-8 in meta
> >> > tag
> >> > :(
> >> >
> >> >
> >> > You need to set Velocity properties to configure the output content
> >> > type.
> >> >
> >> > regards Malcolm
> >> >
> >> > On 11/8/05, Pham Anh Tuan <[EMAIL PROTECTED]> wrote:
> >> >>
> >> >> Hi all,
> >> >>
> >> >> I use Struts Framework + Tiles + Velocity, I had set in .vm file with
> >> >> a
> >> >> header like below:
> >> >>
> >> >> <html>
> >> >> <head>
> >> >> <meta http-equiv="content-type" content="text/html; charset=utf-8">
> >> >> <title>test</title>
> >> >> </head>
> >> >> ....
> >> >>
> >> >> but after the action of Struts, the page which is showed is not
> >> >> encoded
> >> >> in
> >> >> utf-8, so t content in that page are not viewed in utf-8 :(
> >> >>
> >> >> I don't know what happened, plz help me!
> >> >>
> >> >> Tuan
> >> >>
> >> >
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > 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]
> >>
> >>
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to