Thanks for replying!
I did as you suggested and added the messages to MyApp.properties. I now
get the proper message for com.my.company.MyStringValidator. However
there's still a problem with the pattern validator. I am expecting my
message to be displayed as defined in MyApp.properties:
MyPatternValidator=${input} contains invalid characters.
Instead, I get the wicket/Application.properties message:
PatternValidator='${input}' does not match pattern '${pattern}'
Is this related to the same issue you mentioned? I suppose I could make
MyPatternValidator a subclass of StringValidator, but would prefer to have
it subclass PatternValidator.
Thanks again!
Shelli
-----Original Message-----
From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
Sent: Friday, December 28, 2007 5:03 PM
To: [email protected]
Subject: Re: Can't Find/Load Properties Files
we do not currently check ValidatorClassName.properties files, there
is an rfe open for that in jira and will go into 1.3.1 or 1.4.0.
for now i would put those new properties into yourapplication.properties
-igor
On Dec 28, 2007 1:36 PM, Shelli D. Orton <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I asked a variation of this question recently but didn't get a response.
I'm still stumped, so am trying again. I am using Wicket 1.2.6 and Tomcat
5.0.28 and have created 2 custom validators:
>
> com.my.company.MyPatternValidator
> com.my.company.MyStringValidator
>
> where MyPatternValidator extends PatternValidator and MyStringValidator
extends StringValidator. I have also created properties files for each
class within a directory structure that match the classpath:
>
> com/my/company/MyPatternValidator.properties
> com/my/company/MyStringValidator.properties
>
>
> The class that extends PatternValidator uses the default message from
Application.properties instead of the message defined in its properties
file. The logs show that the Wizard and Application resources are being
loaded:
>
> Dec 28, 2007 2:31:24 PM wicket.resource.PropertiesFactory
loadPropertiesFileAndWatchForChanges
> INFO: Loading properties files from
file:/C:/tomcat-5.0.28/work/Catalina/localhost/myApp/loader/wicket/extension
s/wizard/Wizard.properties
> Dec 28, 2007 2:31:34 PM wicket.resource.PropertiesFactory
loadPropertiesFileAndWatchForChanges
> INFO: Loading properties files from
file:/C:/tomcat-5.0.28/work/Catalina/localhost/myApp/loader/wicket/Applicati
on.properties
>
> The other that extends StringValidator throws this exception:
>
> java.util.MissingResourceException: Unable to find resource:
MyStringValidator for component: wizard:form:view:service.name
>
> I have checked and tomcat-5.0.28/work/Catalina/localhost/myApp also
contains /com/my/company/MyPatternValidator.properties and
/com/my/company/MyStringValidator.properties files.
>
> Can somebody please explain to me (or point me to a resource) how to set
up properties files in Wicket so that they can be found? Any help is
greatly appreciated!
>
> Shelli
>
>
> ---------------------------------------------------------------------
> 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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]