Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating Multi Language Pages

 
Luke Shannon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64844
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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: 239
  • Mark post as helpful
  • send pies
  • 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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64844
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both. It is all clear now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic