You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marsman <ma...@gmx.de> on 2009/07/23 12:24:50 UTC

s2 and default locale/language

Hi!

I got a problem with Struts 2 and selecting the language dependent
properties file. When I got a properties file for language "de" (my home
country), it's allways taken by Struts. Even if I configure language "dk" or
"es" in my browser.

I got the following files in my web application:

package.properties
package_de.properties
global-messages.properties
global-messages_de.properties

As far as I know, the file "package.properties" should be taken as fallback
because there isn't any package_dk.properties. I've verified the Struts
configuration with the config-browser-plugin. I don't have configured any
default-locale. Why is Struts using "de" anyway?

Titus

-- 
View this message in context: http://www.nabble.com/s2-and-default-locale-language-tp24623075p24623075.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s2 and default locale/language

Posted by Marsman <ma...@gmx.de>.

No, I've removed this property and got the same behaviour. Even when I set
this Struts configuration property to "en_US", the german language
properties file has been taken! Only after setting Tomcat to "en_US"
everything works as aspected...


<constant name="struts.locale" value="en_US" />


Is it possible you have the locale configured in your struts.xml like this
--

<constant name="struts.locale" value="de_De" />

If so, you're properties files will not change based on locale.


--- In struts@yahoogroups.com, Marsman <ma...@...> wrote:
>
>
>
> Hi!
>
> meanwhile I've found something interresting: My application is running on
> Apache Tomcat. When I set the
> "-Duser.language=en -Duser.region=US" for Tomcat, Struts doesn't use de as
> default language anymore.
>
>

-- 
View this message in context: http://www.nabble.com/s2-and-default-locale-language-tp24623075p24656757.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s2 and default locale/language

Posted by kaphilmore <ke...@sbcglobal.net>.
Is it possible you have the locale configured in your struts.xml like this --

<constant name="struts.locale" value="de_De" /> 

If so, you're properties files will not change based on locale.


--- In struts@yahoogroups.com, Marsman <ma...@...> wrote:
>
> 
> 
> Hi!
> 
> meanwhile I've found something interresting: My application is running on
> Apache Tomcat. When I set the 
> "-Duser.language=en -Duser.region=US" for Tomcat, Struts doesn't use de as
> default language anymore.
> 
> 
> Titus
> 
> 
> 
> Pascal-53 wrote:
> > 
> > Hm, ok. Could you post your resource bundle initialization/usage?
> > 
> > Pascal
> > 
> > On Thu, 23 Jul 2009 04:18:50 -0700 (PDT), Marsman <ma...@...> wrote:
> >> I've tried the browser language detection page and as I expected only the
> >> language code "da-DK" was listed. I had already removed the languages
> > de-DE
> >> and en-US an the browser and addad da-Dk to test my Struts configuration.
> >> 
> >> Titus
> >> 
> >> 
> >> 
> >> Pascal-53 wrote:
> >>> 
> >>> Are you sure your browser settings are correct? I bet it's on the client
> >>> side, not a struts/config error.
> >>> 
> >>> Try using some page to detect your language setting, like
> >>> http://aruljohn.com/lang.php
> >>> 
> >>> Hope this helps,
> >>> 
> >>> Pascal
> >>> 
> >>> On Thu, 23 Jul 2009 03:24:50 -0700 (PDT), Marsman <ma...@...>
> >>> wrote:
> >>>> Hi!
> >>> 
> >>>
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@...
> > For additional commands, e-mail: user-help@...
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/s2-and-default-locale-language-tp24623075p24642168.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s2 and default locale/language

Posted by Marsman <ma...@gmx.de>.

Hi!

meanwhile I've found something interresting: My application is running on
Apache Tomcat. When I set the 
"-Duser.language=en -Duser.region=US" for Tomcat, Struts doesn't use de as
default language anymore.


Titus



Pascal-53 wrote:
> 
> Hm, ok. Could you post your resource bundle initialization/usage?
> 
> Pascal
> 
> On Thu, 23 Jul 2009 04:18:50 -0700 (PDT), Marsman <ma...@gmx.de> wrote:
>> I've tried the browser language detection page and as I expected only the
>> language code "da-DK" was listed. I had already removed the languages
> de-DE
>> and en-US an the browser and addad da-Dk to test my Struts configuration.
>> 
>> Titus
>> 
>> 
>> 
>> Pascal-53 wrote:
>>> 
>>> Are you sure your browser settings are correct? I bet it's on the client
>>> side, not a struts/config error.
>>> 
>>> Try using some page to detect your language setting, like
>>> http://aruljohn.com/lang.php
>>> 
>>> Hope this helps,
>>> 
>>> Pascal
>>> 
>>> On Thu, 23 Jul 2009 03:24:50 -0700 (PDT), Marsman <ma...@gmx.de>
>>> wrote:
>>>> Hi!
>>> 
>>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/s2-and-default-locale-language-tp24623075p24642168.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s2 and default locale/language

Posted by Marsman <ma...@gmx.de>.

I'm simply using a text-tag like this one on my JSP:

<s:text name="homepage.headline" />

The problem isn't that the message text would not be found. Also when I try
the same with another language, the message bundle corresponding to this
language will be taken by Struts. But as soon as I got a "de" message
bundle, Struts allways takes it. Whatever language is prefered by the
browser.

Titus



Pascal-53 wrote:
> 
> Hm, ok. Could you post your resource bundle initialization/usage?
> 
> Pascal
> 
> On Thu, 23 Jul 2009 04:18:50 -0700 (PDT), Marsman <ma...@gmx.de> wrote:
>> I've tried the browser language detection page and as I expected only the
>> language code "da-DK" was listed. I had already removed the languages
> de-DE
>> and en-US an the browser and addad da-Dk to test my Struts configuration.
>> 
>> Titus
> 
> 

-- 
View this message in context: http://www.nabble.com/s2-and-default-locale-language-tp24623075p24625622.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s2 and default locale/language

Posted by Pascal <pa...@voidmage.net>.
Hm, ok. Could you post your resource bundle initialization/usage?

Pascal

On Thu, 23 Jul 2009 04:18:50 -0700 (PDT), Marsman <ma...@gmx.de> wrote:
> I've tried the browser language detection page and as I expected only the
> language code "da-DK" was listed. I had already removed the languages
de-DE
> and en-US an the browser and addad da-Dk to test my Struts configuration.
> 
> Titus
> 
> 
> 
> Pascal-53 wrote:
>> 
>> Are you sure your browser settings are correct? I bet it's on the client
>> side, not a struts/config error.
>> 
>> Try using some page to detect your language setting, like
>> http://aruljohn.com/lang.php
>> 
>> Hope this helps,
>> 
>> Pascal
>> 
>> On Thu, 23 Jul 2009 03:24:50 -0700 (PDT), Marsman <ma...@gmx.de>
>> wrote:
>>> Hi!
>> 
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s2 and default locale/language

Posted by Marsman <ma...@gmx.de>.
I've tried the browser language detection page and as I expected only the
language code "da-DK" was listed. I had already removed the languages de-DE
and en-US an the browser and addad da-Dk to test my Struts configuration.

Titus



Pascal-53 wrote:
> 
> Are you sure your browser settings are correct? I bet it's on the client
> side, not a struts/config error.
> 
> Try using some page to detect your language setting, like
> http://aruljohn.com/lang.php
> 
> Hope this helps,
> 
> Pascal
> 
> On Thu, 23 Jul 2009 03:24:50 -0700 (PDT), Marsman <ma...@gmx.de> wrote:
>> Hi!
> 
> 

-- 
View this message in context: http://www.nabble.com/s2-and-default-locale-language-tp24623075p24623739.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s2 and default locale/language

Posted by Pascal <pa...@voidmage.net>.
Are you sure your browser settings are correct? I bet it's on the client
side, not a struts/config error.

Try using some page to detect your language setting, like
http://aruljohn.com/lang.php

Hope this helps,

Pascal

On Thu, 23 Jul 2009 03:24:50 -0700 (PDT), Marsman <ma...@gmx.de> wrote:
> Hi!
> 
> I got a problem with Struts 2 and selecting the language dependent
> properties file. When I got a properties file for language "de" (my home
> country), it's allways taken by Struts. Even if I configure language "dk"
> or
> "es" in my browser.
> 
> I got the following files in my web application:
> 
> package.properties
> package_de.properties
> global-messages.properties
> global-messages_de.properties
> 
> As far as I know, the file "package.properties" should be taken as
fallback
> because there isn't any package_dk.properties. I've verified the Struts
> configuration with the config-browser-plugin. I don't have configured any
> default-locale. Why is Struts using "de" anyway?
> 
> Titus

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Setting HTTP Headers in SOAPMessage

Posted by Marsman <ma...@gmx.de>.
...are you in the right thread??



Neil Meyer-2 wrote:
> 
> Hi,
> 
> I have a problem that I really can't seem to resolve. 
> Neil Meyer
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/s2-and-default-locale-language-tp24623075p24624299.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Setting HTTP Headers in SOAPMessage

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Neil,
You can try to use Axis as as a web services client.

Best greetings,
Paweł Wielgus.


2009/7/23 Neil Meyer <ne...@vscsolutions.co.za>:
> Hi,
>
> I have a problem that I really can't seem to resolve. I have downloaded some code from code Ranch called SAAJClient. This is now part of my struts project. I receive data from a client on my web which I then have to post through to a different client via webservices using javax.xml.soap.*
>
> I set the http Headers to do Authentication but when I snoop the post going out none of the headers that I have set are present.
>
>            String authorization = new sun.misc.BASE64Encoder().encode((username+":"+password).getBytes());
>            MimeHeaders hd = message.getMimeHeaders();
>            hd.addHeader("Authorization", "Basic " + authorization);
>
> I really don't know where to look anymore for a solution on this and would appreciate any comments on this.
>
> Kind Regards,
>
> Neil Meyer
>
> t. +27 (0) 11 523 4804  |  f. +27 (0) 11 523 4801  |  m. +27 (0) 82 474 7304
> e. neil.meyer@vscsolutions.co.za  |  w. www.vscsolutions.co.za
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Setting HTTP Headers in SOAPMessage

Posted by Neil Meyer <ne...@vscsolutions.co.za>.
Hi,

I have a problem that I really can't seem to resolve. I have downloaded some code from code Ranch called SAAJClient. This is now part of my struts project. I receive data from a client on my web which I then have to post through to a different client via webservices using javax.xml.soap.*

I set the http Headers to do Authentication but when I snoop the post going out none of the headers that I have set are present.

            String authorization = new sun.misc.BASE64Encoder().encode((username+":"+password).getBytes());
            MimeHeaders hd = message.getMimeHeaders();
            hd.addHeader("Authorization", "Basic " + authorization);

I really don't know where to look anymore for a solution on this and would appreciate any comments on this.

Kind Regards,

Neil Meyer

t. +27 (0) 11 523 4804  |  f. +27 (0) 11 523 4801  |  m. +27 (0) 82 474 7304
e. neil.meyer@vscsolutions.co.za  |  w. www.vscsolutions.co.za


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org