Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 19th, 2007, 10:47 AM
Registered User
 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to acgreen
Default Struts 2 default language

Hi everyone,
I'm using Struts 2 and am currently trying to get the default language that struts is using. What I want to do is load some images on the jsp end of the application. Because the website should be available to users in a variety of languages I need to "i18n" the jsp-pages. Therefore I'm looking for an easy way to get the default language that struts is using, because the path to the images I want to load is composed with the language acronym in it.

Short example:
Code:
<img src="/foo/bar/en_US/image_english.jpg" />
<img src="/foo/bar/de_DE/image_german.jpg" />
What I'd like to avoid is using ActionContext.getContext().getLocale() on every class to get the locale. Once the language is set via a "request_locale" link within the website it's available via the constant WW_TRANS_I18N_LOCALE, but before that I have no clue.

Thanks for any advice in advance.
 
Old March 17th, 2008, 06:30 AM
Registered User
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the question that was i wanted to ask for everyone ,i saw this problem in my study.

 
Old March 24th, 2008, 08:07 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

I am not sure but how about using

org.apache.struts2.config.DefaultSettings.getLocal e() method?

http://struts.apache.org/2.0.6/strut...tSettings.html


- Rakesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
struts-html: checkbox default checked RatanKumar Struts 1 November 5th, 2007 05:49 AM
struts actions package: "struts", other packages? ojasrege Struts 1 July 21st, 2007 06:02 AM
check box default value in struts form sridevi Servlets 3 January 15th, 2006 11:13 PM
How to get upgraded from Struts 1.1 to struts 1.2. [email protected] Struts 0 January 3rd, 2006 04:29 AM
Need help with struts pkmleo J2EE 1 February 27th, 2005 06:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.