• 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

Problem With I18n feature of Struts2

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I am trying to create an application with hindi fonts (Only Lable required to be shown in hindi)with the help of Struts2 i18n feature.
I have cretaed required properties file as global_hi.properties
for the label username ,password and submit button.
It works fine for submit button,but for password its showing *??? .
I have attached my jsp ,struts.xml and proerties fiel.
struts.xml is

My jsp file it have

and in properties file


Tanks in advance

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should configure the Browser settings properly this link will clarify your needs http://candidjava.com/struts-1x-i18n-internationalization-with-example-program-in-eclipse
 
jainitya jaiyswal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

Thanks for your quick reply,
I am looking in to the link you have given but it does not help,link says nothing about struts 1x i18n internationalization with example program In Eclipse ,it just have some related article links,
could you please be more specific about the link

Thanks
jainitya
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please elaborate what is the exact issues you are facing here?
 
jainitya jaiyswal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
Trying to implement i18n feature of struts2 for language hindi.
Porpeties file, struts file, and jsp updated,

working fine for submit button but for label it showing as *???.

Please help.
thanks
lsms.png
[Thumbnail for lsms.png]
 
Srinivasa Rao Ammina
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I doubt with the name attribute

<s:textfield required="true" requiredposition="left" maxLength="25" key="global.username" name="userMaster.loginid" />
<s:password required="true" requiredposition="left" maxLength="8" key="global.passwordd" name="userMaster.Password" />

For the above lines of code, please remove the name attributes and try it once. Then also if doesn't work just give the names as loginid and Password

 
jainitya jaiyswal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jsp updated as


and then


but no success.
 
jainitya jaiyswal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I have solved the problem.
The problem is => I am using the tiles plugin in struts 2
and in BaseLayout page,I have


this line is creating the problem
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
after removing the line it works just fine

Although I did not get any reason for this but this trick just work for me,I have got this solution from this link
http://www.mkyong.com/struts2/struts-2-chinese-localization-issue/

Thanks
 
Srinivasa Rao Ammina
Greenhorn
Posts: 20
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good. I am also facing similar kind of issues. Could you please check and let us know do you have any idea about this.

In the french related property file of yours could you please add this \u00e8 at the end of global.submit property ? basically this related a character in french (é)

And click on the submit button and check whether application is loggin correctly or not?

Since if the property files contains the special charters like (é) it is throwing missing resource '<key value'> in key method map

Could you please check this once from u'r end and let us know about this. Since we are not using struts2.0 version

Thanks
 
jainitya jaiyswal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Srinivasa
I have tested this and it works fine,After submitting I am able to login in the application
global_fr.properties


login.png
[Thumbnail for login.png]
 
Srinivasa Rao Ammina
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi jainitya,

Thank you for the confirmation. Then there is some issue with my code. We will check the same.
Thanks again for the help.

Srini
 
jainitya jaiyswal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi just want to tell you that this link
http://www.mkyong.com/struts2/struts-2-chinese-localization-issue/
says
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
In Struts 1, the above meta tag is required to display the UTF-8 data correctly, but this is not true for Struts 2.
Please check if this help.

thanks
Jainitya
 
Srinivasa Rao Ammina
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi jainitya,

Tried with that option also but no luck. Here the issue is, in the jsp's it is showing the correct values either in english or in frensh but after submitting the form internally
it is checking the method name and there is is interpretting diffrently.

For more info you can check the posting of the issue @

https://coderanch.com/t/565389/Struts/Internationalization-special-French-characters

Srini
 
Srinivasa Rao Ammina
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Got the solution

The following lines in the jsp pags causes the issues

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

If we remove these line it is working fine.

Thanks
Srini
 
reply
    Bookmark Topic Watch Topic
  • New Topic