struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pham Anh Tuan" <anht...@ichi-corp.jp>
Subject [HELP] the problem with I18n
Date Wed, 09 Nov 2005 02:42:49 GMT
hi all,

I got a problem with I18n, the browser couldn't automatically turn UTF-8 encoding on when
jsp page is showed, so, the content is showed incorrectly :( ... If I want the content to
show correctly, I must change the encoding setting of the browser to UFT-8, I tested on IE,
Firefox, the result is the same above :(

so, for you clearly understand about my problem, below is my configuration:
---------------------------------------
web.xml
--------------------
<web-app>

 <!-- setting up Struts servlet   -->
 <servlet>
  <servlet-name>action</servlet-name>
  <servlet-class>
   org.apache.struts.action.ActionServlet
  </servlet-class>
  <init-param>
   <param-name>config</param-name>
   <param-value>/WEB-INF/struts-config.xml</param-value>
  </init-param>
  <init-param>
   <param-name>debug</param-name>
   <param-value>2</param-value>
  </init-param>
  <init-param>
   <param-name>detail</param-name>
   <param-value>2</param-value>
  </init-param>
  
  <init-param>
   <param-name>locale</param-name>
   <param-value>true</param-value>
  </init-param>
  
  <init-param>
   <param-name>application</param-name>
   <param-value>properties.languages_vn</param-value>
  </init-param>

  <load-on-startup>2</load-on-startup>
 </servlet>


 <!-- Map *.do files -->
 <servlet-mapping>
  <servlet-name>action</servlet-name>
  <url-pattern>*.do</url-pattern>
 </servlet-mapping>

 <session-config>
  <session-timeout>30</session-timeout>
 </session-config>

 <!-- default page load -->
 <welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>
......

---------------------------------------------------
struts-config.xml
------------------------------
.........
 <global-forwards>
  <!--  go to homepage -->
  <forward name="goToHomepage" path="/vm/MyJsp.jsp"
   redirect="true" contextRelative="true" />
 </global-forwards>

 <action-mappings>
 </action-mappings>
 <message-resources parameter="properties.languages_vn" />
......

-------------------------------------------------
MyJsp.jsp
---------------------
<%@ taglib uri="struts-bean" prefix="bean" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
     <title>MyJsp.jsp</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    This a struts page. <br>
    <bean:message key="welcome"/>
  </body>
</html>

-------------------------------------------------
languages_vn.properties - save with UTF-8 encoding
---------------------
welcome=ひらがな



what happened :( ... help me :(

Tuan

Mime
View raw message