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



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

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


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

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


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

Reply via email to