I'm sure you've already checked, but a double-check might be helpful:
what is the actual entry in package.properties? For example, do you have
a typo in your key there? Did you name that hello.key instead of
Hello.key?

You know, the usual things that are obvious once you actually see
them...

Chris

-----Original Message-----
From: Ian Roughley [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 09, 2007 4:00 PM
To: Struts Users Mailing List
Subject: Re: Bug in 2.0.9 regarding validation localization?

Now I know that it works with package.properties.  Have you tried using 
a key without a period?

/Ian

Dean Pullen wrote:
> Even adding a package.properties or even a className.properties (where
> className is my Action class name) doesn't resolve the problem.
>
> This is a huge sticking point for me, I sincerely hope someone can
help.
>
> Dean.
>
> -----Original Message-----
> From: Dean Pullen [mailto:[EMAIL PROTECTED] 
> Sent: 09 October 2007 20:05
> To: Struts Users Mailing List
> Subject: RE: Bug in 2.0.9 regarding validation localization?
>
> Thanks Ian.
>
> This is in struts.xml:
> struts.custom.i18n.resources=struts-messages
>
> If thats what you mean?
>
> I get other localized properties from it no problem, e.g. using
<s:text
> name="key.here "/>
>
>
>
> -----Original Message-----
> From: Ian Roughley [mailto:[EMAIL PROTECTED] 
> Sent: 09 October 2007 19:48
> To: Struts Users Mailing List
> Subject: Re: Bug in 2.0.9 regarding validation localization?
>
> I can confirm that it works.  Do you have the
struts-messages.properties
>
> defined as an additional properties file in struts.xml?  This is not a

> standard property file name that is picked up by default.
>
> /Ian
>
> Dean Pullen wrote:
>   
>> Further to my message below,
>> com.opensymphony.xwork2.util.LocalizedTextUtil.createMissesKey()
>>     
> method
>   
>> hasn't been implemented until 2.0.8.
>>
>> Can anyone confirm that they have localized validation working, as
>> below, with 2.0.9?
>>
>> Thanks,
>>
>> Dean.
>>
>> -----Original Message-----
>> From: Dean Pullen [mailto:[EMAIL PROTECTED] 
>> Sent: 09 October 2007 19:23
>> To: Struts Users Mailing List
>> Subject: RE: Validation problem - key not found?
>>
>> I've tried adding a package.properties with the same key but nothing
>> seems to help - I still seem to get the same exception.
>>
>> Anyone?
>>
>> -----Original Message-----
>> From: Dean Pullen [mailto:[EMAIL PROTECTED] 
>> Sent: 09 October 2007 18:08
>> To: Struts Users Mailing List
>> Subject: Validation problem - key not found?
>>
>>  
>>
>> Hi all.
>>
>>  
>>
>> Trying to do this:
>>
>>  
>>
>> @RequiredStringValidator(message = "Hello", key = "Hello.key")
>>
>> public String getQuestion1Option()
>>
>> {
>>
>> return question1Option;
>>
>> }
>>
>>  
>>
>>  
>>
>> But receiving this error on submission of the action:
>>
>>  
>>
>> [09 Oct 2007 17:54:46] ERROR
>> org.apache.catalina.core.ContainerBase.[jboss.web].
>>
>> [localhost].[/csi].[default]  - Servlet.service() for servlet default
>> threw exce
>>
>> ption
>>
>> java.lang.NullPointerException
>>
>>         at
>> com.opensymphony.xwork2.util.LocalizedTextUtil.createMissesKey(Locali
>>
>> zedTextUtil.java:240)
>>
>>         at
>> com.opensymphony.xwork2.util.LocalizedTextUtil.findResourceBundle(Loc
>>
>> alizedTextUtil.java:219)
>>
>>         at
>> com.opensymphony.xwork2.util.LocalizedTextUtil.getMessage(LocalizedTe
>>
>> xtUtil.java:602)
>>
>>         at
>> com.opensymphony.xwork2.util.LocalizedTextUtil.findMessage(LocalizedT
>>
>> extUtil.java:643)
>>
>>         at
>> com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedText
>>
>> Util.java:360)
>>
>>         at
>> com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedText
>>
>> Util.java:293)
>>
>>         at
>> com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSuppo
>>
>> rt.java:173)
>>
>>         at
>> com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSuppo
>>
>> rt.java:104)
>>
>>         at
>> com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:75)
>>
>>         at
>> com.opensymphony.xwork2.validator.DelegatingValidatorContext.getText(
>>
>> DelegatingValidatorContext.java:106)
>>
>>         at
>> com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMess
>>
>> age(ValidatorSupport.java:66)
>>
>>         at
>> com.opensymphony.xwork2.validator.validators.ValidatorSupport.addFiel
>>
>> dError(ValidatorSupport.java:162)
>>
>>         at
>> com.opensymphony.xwork2.validator.validators.RequiredStringValidator.
>>
>> validate(RequiredStringValidator.java:77)
>>
>>  
>>
>> etc
>>
>>  
>>
>>  
>>
>> Any idea what's wrong? The key is in my struts-messages.properties
and
>> struts-messages_en.properties
>>
>>  
>>
>> Cheers


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to