• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Creating Multi Language Pages

 
Ranch Hand
Posts: 240
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello;

Our site is moving to multi language.

All of our actions extand a base action. On that page I have added the following:

response.setContentType("text/html; charset=UTF-8");

However when I look at the source of a generated html page I don't see a meta tag with the charset equal to UTF-8.

Before I start tracing the response object to see if the type is being over written what should I expect to see in the generated HTML when setting the type in this way?

Also does any one have any other tips/suggestions related to adding multi language support to an existing site (previously only english).

Thanks,

Luke
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why on earth would you expect HTML to be magically generated? If you want some HTML to be on your page, you're going to need to put it there.
[ June 27, 2006: Message edited by: Bear Bibeault ]
 
Luke Shannon
Ranch Hand
Posts: 240
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am unclear about what calling response.setContentType("text/html; charset=UTF-8"); does. The documentation says:

Sets the content type of the response being sent to the client.

I was having trouble understanding how this was achieved (ie: How I can verify it is working).

I just found this blog posting, it works with JSP, but is doing something similar to what I want to do:

web page
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It does but not by generating a meta tag.

It sets the Content-Type HTTP header.
If you would like to see the headers being passed back and forth from server to client, download the LiveHTTPHeaders plugin for FireFox.

http://livehttpheaders.mozdev.org/
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Luke Shannon:
I am unclear about what calling response.setContentType("text/html; charset=UTF-8");



Exactly as the docs say, it sets the content type and char set of the response being sent to the client so that the browser knows what type of file it is (an HTML page vs. an image, for example) and what the char set of the response body is.
 
Luke Shannon
Ranch Hand
Posts: 240
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you both. It is all clear now.
 
reply
    Bookmark Topic Watch Topic
  • New Topic