struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Pullen" <dean.pul...@msp-uk.com>
Subject RE: Bug in 2.0.9 regarding validation localization?
Date Tue, 09 Oct 2007 21:14:17 GMT
God, I must of tried everything possible by now.

Has anyone got anytime to package me a working test case, to see if
there's something odd with my application server?

Or does anyone have any other ideas. The exception is quite explicit,
I'd file a bug, but there doesn't seem to be any recent activity on the
Struts 2 JIRA.

-----Original Message-----
From: Dean Pullen [mailto:dean.pullen@msp-uk.com] 
Sent: 09 October 2007 21:46
To: Struts Users Mailing List
Subject: RE: Bug in 2.0.9 regarding validation localization?

Currently struts.locale=en although I previously had it as en_GB prior
to trying to debug this problem.

SalesSurveyAction extends several Actions which ultimately extend
ActionSupport.

struts.i18n.reload=true isn't set, but I am restarting the apps server
fully each time.

-----Original Message-----
From: Ian Roughley [mailto:ian@fdar.com] 
Sent: 09 October 2007 21:42
To: Struts Users Mailing List
Subject: Re: Bug in 2.0.9 regarding validation localization?

what is the values of struts.locale, and does the SalesSurveyAction 
extend ActionSupport or does your action implement the TextProvider and 
LocaleProvider interfaces?

Also, do you have struts.i18n.reload=true, or are you restarting the app

server after each modification?

/Ian

Dean Pullen wrote:
> Just to refresh, we now have:
>
> @RequiredStringValidator(message = "hello", key = "hello")
> public String getQuestion1Option()
> {
> 	return question1Option;
> }
>
> In class: SalesSurveyAction, in package: com.msp.web.csi.surveys.sales
>
> I have a SalesSurveyAction.properties and a package.properties, (exact
> naming), in the same folder.
>
> They both contain: hello=Hello
>
>
>
> -----Original Message-----
> From: Ian Roughley [mailto:ian@fdar.com] 
> Sent: 09 October 2007 21:00
> 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:dean.pullen@msp-uk.com] 
>> 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:ian@fdar.com] 
>> 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:dean.pullen@msp-uk.com] 
>>> 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:dean.pullen@msp-uk.com] 
>>> 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
>>>
>>>
>>>
>>> Scanned by MailDefender - managed email security from intY -
>>> www.maildefender.net
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>> Scanned by MailDefender - managed email security from intY -
>>> www.maildefender.net
>>>
>>>
---------------------------------------------------------------------
>>> 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
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>   
>>     
>
>
> Scanned by MailDefender - managed email security from intY -
> www.maildefender.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

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


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

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


Mime
View raw message