You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Shelli D. Orton" <sh...@wmode.com> on 2007/12/13 01:06:16 UTC

Trouble Localizing Validator Messages

Hi,

I'm working on my first Wicket app and am hoping someone can tell me what I'm doing wrong. I have a wizard component and on one of the steps I've added a custom pattern validator (MyPatternValidator extends PatternValidator) to one of the text fields.  

When the validation fails, I get the default wicket Application.properties message:

    PatternValidator='${input}' does not match pattern '${pattern}'

I created a resource bundle to override the message with a single entry:

    MyPatternValidator=${input} contains invalid characters.

Originally I created this in a MyApplication.properties resource bundle (MyApplication being the Application class name) so that it was available application wide.  However, the app always returned the default message and the logs only indicated that Wizard.properties file was loaded:

    Dec 12, 2007 4:50:30 PM wicket.resource.PropertiesFactory loadPropertiesFileAndWatchForChanges
    INFO: Loading properties files from file:/C:/tomcat-5.0.28/work/Catalina/localhost/myApp/loader/wicket/extensions/wizard/Wizard.properties

I renamed the properties file to match my base page class and redeployed (MyBasePage.properties).  MyPage extends the MyBasePage and contains the Wizard.  Again, I get the default message displayed, but the logs show that the page specifice properties file was loaded and also the Application.properties file (which didn't show in the first try???):

    Dec 12, 2007 4:59:12 PM wicket.resource.PropertiesFactory loadPropertiesFileAndWatchForChanges
    INFO: Loading properties files from file:/C:/tomcat-5.0.28/webapps/myApp/WEB-INF/classes/com/my/application/MyPage.properties
    Dec 12, 2007 4:59:12 PM wicket.resource.PropertiesFactory loadPropertiesFileAndWatchForChanges
    INFO: Loading properties files from file:/C:/tomcat-5.0.28/work/Catalina/localhost/myApp/loader/wicket/extensions/wizard/Wizard.properties
    Dec 12, 2007 4:59:18 PM wicket.resource.PropertiesFactory loadPropertiesFileAndWatchForChanges
    INFO: Loading properties files from file:/C:/tomcat-5.0.28/work/Catalina/localhost/myApp/loader/wicket/Application.properties

I suspect I may have an issue with where I'm putting the properties file, but if it loaded the file, why wouldn't it read/use the message?

Any help/insight would be greatly appreciated.

Thanks!
Shelli


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Trouble Localizing Validator Messages

Posted by "Shelli D. Orton" <sh...@wmode.com>.
Can anyone help me set up my properties file correctly?

Thanks in advance!

Shelli

-----Original Message-----
From: Shelli D. Orton [mailto:shelli.orton@wmode.com] 
Sent: Thursday, December 13, 2007 9:13 AM
To: users@wicket.apache.org
Subject: RE: Trouble Localizing Validator Messages

Hi,

I'm using 1.2.5

Shelli 

-----Original Message-----
From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
Sent: Thursday, December 13, 2007 1:38 AM
To: users@wicket.apache.org
Subject: Re: Trouble Localizing Validator Messages

Which version of Wicket are you using?
Martijn

On Dec 13, 2007 1:06 AM, Shelli D. Orton <sh...@wmode.com> wrote:

> Hi,
>
> I'm working on my first Wicket app and am hoping someone can tell me what
> I'm doing wrong. I have a wizard component and on one of the steps I've
> added a custom pattern validator (MyPatternValidator extends
> PatternValidator) to one of the text fields.
>
> When the validation fails, I get the default wicket
Application.propertiesmessage:
>
>    PatternValidator='${input}' does not match pattern '${pattern}'
>
> I created a resource bundle to override the message with a single entry:
>
>    MyPatternValidator=${input} contains invalid characters.
>
> Originally I created this in a MyApplication.properties resource bundle
> (MyApplication being the Application class name) so that it was available
> application wide.  However, the app always returned the default message
and
> the logs only indicated that Wizard.properties file was loaded:
>
>    Dec 12, 2007 4:50:30 PM
wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
>
/work/Catalina/localhost/myApp/loader/wicket/extensions/wizard/Wizard.proper
ties
>
> I renamed the properties file to match my base page class and redeployed (
> MyBasePage.properties).  MyPage extends the MyBasePage and contains the
> Wizard.  Again, I get the default message displayed, but the logs show
that
> the page specifice properties file was loaded and also the
> Application.properties file (which didn't show in the first try???):
>
>    Dec 12, 2007 4:59:12 PM
wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
> /webapps/myApp/WEB-INF/classes/com/my/application/MyPage.properties
>    Dec 12, 2007 4:59:12 PM
wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
>
/work/Catalina/localhost/myApp/loader/wicket/extensions/wizard/Wizard.proper
ties
>    Dec 12, 2007 4:59:18 PM
wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
> /work/Catalina/localhost/myApp/loader/wicket/Application.properties
>
> I suspect I may have an issue with where I'm putting the properties file,
> but if it loaded the file, why wouldn't it read/use the message?
>
> Any help/insight would be greatly appreciated.
>
> Thanks!
> Shelli
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Trouble Localizing Validator Messages

Posted by "Shelli D. Orton" <sh...@wmode.com>.
Hi,

I'm using 1.2.5

Shelli 

-----Original Message-----
From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
Sent: Thursday, December 13, 2007 1:38 AM
To: users@wicket.apache.org
Subject: Re: Trouble Localizing Validator Messages

Which version of Wicket are you using?
Martijn

On Dec 13, 2007 1:06 AM, Shelli D. Orton <sh...@wmode.com> wrote:

> Hi,
>
> I'm working on my first Wicket app and am hoping someone can tell me what
> I'm doing wrong. I have a wizard component and on one of the steps I've
> added a custom pattern validator (MyPatternValidator extends
> PatternValidator) to one of the text fields.
>
> When the validation fails, I get the default wicket
Application.propertiesmessage:
>
>    PatternValidator='${input}' does not match pattern '${pattern}'
>
> I created a resource bundle to override the message with a single entry:
>
>    MyPatternValidator=${input} contains invalid characters.
>
> Originally I created this in a MyApplication.properties resource bundle
> (MyApplication being the Application class name) so that it was available
> application wide.  However, the app always returned the default message
and
> the logs only indicated that Wizard.properties file was loaded:
>
>    Dec 12, 2007 4:50:30 PM
wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
>
/work/Catalina/localhost/myApp/loader/wicket/extensions/wizard/Wizard.proper
ties
>
> I renamed the properties file to match my base page class and redeployed (
> MyBasePage.properties).  MyPage extends the MyBasePage and contains the
> Wizard.  Again, I get the default message displayed, but the logs show
that
> the page specifice properties file was loaded and also the
> Application.properties file (which didn't show in the first try???):
>
>    Dec 12, 2007 4:59:12 PM
wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
> /webapps/myApp/WEB-INF/classes/com/my/application/MyPage.properties
>    Dec 12, 2007 4:59:12 PM
wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
>
/work/Catalina/localhost/myApp/loader/wicket/extensions/wizard/Wizard.proper
ties
>    Dec 12, 2007 4:59:18 PM
wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
> /work/Catalina/localhost/myApp/loader/wicket/Application.properties
>
> I suspect I may have an issue with where I'm putting the properties file,
> but if it loaded the file, why wouldn't it read/use the message?
>
> Any help/insight would be greatly appreciated.
>
> Thanks!
> Shelli
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Trouble Localizing Validator Messages

Posted by Martijn Dashorst <ma...@gmail.com>.
Which version of Wicket are you using?
Martijn

On Dec 13, 2007 1:06 AM, Shelli D. Orton <sh...@wmode.com> wrote:

> Hi,
>
> I'm working on my first Wicket app and am hoping someone can tell me what
> I'm doing wrong. I have a wizard component and on one of the steps I've
> added a custom pattern validator (MyPatternValidator extends
> PatternValidator) to one of the text fields.
>
> When the validation fails, I get the default wicket Application.propertiesmessage:
>
>    PatternValidator='${input}' does not match pattern '${pattern}'
>
> I created a resource bundle to override the message with a single entry:
>
>    MyPatternValidator=${input} contains invalid characters.
>
> Originally I created this in a MyApplication.properties resource bundle
> (MyApplication being the Application class name) so that it was available
> application wide.  However, the app always returned the default message and
> the logs only indicated that Wizard.properties file was loaded:
>
>    Dec 12, 2007 4:50:30 PM wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
> /work/Catalina/localhost/myApp/loader/wicket/extensions/wizard/Wizard.properties
>
> I renamed the properties file to match my base page class and redeployed (
> MyBasePage.properties).  MyPage extends the MyBasePage and contains the
> Wizard.  Again, I get the default message displayed, but the logs show that
> the page specifice properties file was loaded and also the
> Application.properties file (which didn't show in the first try???):
>
>    Dec 12, 2007 4:59:12 PM wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
> /webapps/myApp/WEB-INF/classes/com/my/application/MyPage.properties
>    Dec 12, 2007 4:59:12 PM wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
> /work/Catalina/localhost/myApp/loader/wicket/extensions/wizard/Wizard.properties
>    Dec 12, 2007 4:59:18 PM wicket.resource.PropertiesFactoryloadPropertiesFileAndWatchForChanges
>    INFO: Loading properties files from file:/C:/tomcat-5.0.28
> /work/Catalina/localhost/myApp/loader/wicket/Application.properties
>
> I suspect I may have an issue with where I'm putting the properties file,
> but if it loaded the file, why wouldn't it read/use the message?
>
> Any help/insight would be greatly appreciated.
>
> Thanks!
> Shelli
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/

RE: Can't Find/Load Properties Files

Posted by "Shelli D. Orton" <sh...@wmode.com>.
I overrode resourceKey() but still no luck.  I subclassed StringValidator
instead, and am now getting the message I want.

Thanks again for your help.

Shelli 

-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Sent: Tuesday, January 01, 2008 11:00 AM
To: users@wicket.apache.org
Subject: Re: Can't Find/Load Properties Files

not sure why it does that. PatternValidator already extends StringValidator.

go ahead and override resourceKey() and return "MyPatternValidator"

-igor


On Dec 31, 2007 9:45 AM, Shelli D. Orton <sh...@wmode.com> wrote:
> 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:igor.vaynberg@gmail.com]
> Sent: Friday, December 28, 2007 5:03 PM
> To: users@wicket.apache.org
> 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 <sh...@wmode.com> 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: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Can't Find/Load Properties Files

Posted by Igor Vaynberg <ig...@gmail.com>.
not sure why it does that. PatternValidator already extends StringValidator.

go ahead and override resourceKey() and return "MyPatternValidator"

-igor


On Dec 31, 2007 9:45 AM, Shelli D. Orton <sh...@wmode.com> wrote:
> 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:igor.vaynberg@gmail.com]
> Sent: Friday, December 28, 2007 5:03 PM
> To: users@wicket.apache.org
> 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 <sh...@wmode.com> 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: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Can't Find/Load Properties Files

Posted by "Shelli D. Orton" <sh...@wmode.com>.
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:igor.vaynberg@gmail.com] 
Sent: Friday, December 28, 2007 5:03 PM
To: users@wicket.apache.org
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 <sh...@wmode.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Can't Find/Load Properties Files

Posted by Igor Vaynberg <ig...@gmail.com>.
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 <sh...@wmode.com> 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/extensions/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/Application.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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Can't Find/Load Properties Files

Posted by "Shelli D. Orton" <sh...@wmode.com>.
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/extensions/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/Application.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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org