Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3854574
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:38:37+00:00 2026-05-19T17:38:37+00:00

I am developing struts 2 and spring web application which suppoerts two languages: english

  • 0

I am developing struts 2 and spring web application which suppoerts two languages: english and hindi.
I have configured internationalization but it is not working i.e. when I change the encoding from browser, the text does not change.
I have tried to even change the locale programitically but it still does not work

RegisterAction.java

    public class RegisterAction extends ActionSupport {

 public String execute(){
  return "SUCCESS";
 }

 public Locale getLocale(){
  return new Locale("hi");
 }
    }

struts.xml

<action name="register" class="com.medics.action.RegisterAction">
    <result name="SUCCESS">/Register.jsp</result>
</action>

Register.jsp

<%@ taglib prefix="s" uri="/struts-tags"  %>
<h4><s:text name="Registration"/></h4>

global-messages.properties

hello=hello
Registration=Registration

global-messages_hi.properties

Registration=\\u2354\\u2379\\u327\\u2367\\u2344\\u2381

here is the snapshot of the project

struts.xml and the two messages files are in the root of the classpath

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:38:38+00:00Added an answer on May 19, 2026 at 5:38 pm

    Unfortunately, you named your keys the same as your values in English, so you can’t really tell if the English bundle is being loaded properly either. My first guess is that Struts does not know that global-messages*.properties are language bundles.

    Try adding this to your struts.xml:

    <constant name="struts.custom.i18n.resources" value="global-messages"/>
    

    Edit

    If you are sure that the English bundle is loading, then you’ll want to debug the application to confirm that the Hindi locale is being set properly by Struts2. A breakpoint in your action should allow you to easily check the value of getLocale().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a web application which uses framework like Struts and Hibernate. Currently I'm developing
I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have
I am developing a small application using Struts, Spring and hibernate3. But now I
I am developing a web application using Struts 1.2.7 I want to print a
I am developing a Java EE web application using Struts. The problem is with
I am developing a new web application with Struts2, Spring and Hibernate as its
I am developing a web application in struts2. I have declared global properties in
I am using struts2 for developing a web application. I have include the required
I am developing an application in struts 2 and hibernate 3. I have 3
I am developing a web application using Apache Struts, to be deployed on JBoss

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.