• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problems with MessageResources on my validation.xml

 
Greenhorn
Posts: 1
Eclipse IDE Tomcat Server Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!!!

I'm having problems with my application trying to configure a separate MessageResources for validation. I have two MessageResources: one for common messages and other just for error messages.
Problems come when I try to use it cause I always get the same error: Cannot find message resources under key org.apache.struts.action.MESSAGE. I think it's because in validator.xml i 've used the bundle attribute with arg field and the application can't relate this attribute with message resource files.

There'are some configuration fragments to clarify this:

my struts-config.xml 's section relative to validation and message-resources:

<message-resources parameter="i18n.templateMessages.MessageResources" key="templateMessages" null="false"/>
<message-resources parameter="i18n.errorMesages.MessageResources" key="errorMessages" null="false"/>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validation.xml,/org/apache/struts/validator/validator-rules.xml"/>
</plug-in>

and my validator.xml section

<formset>
<form name="registerForm" >
<field property="user" depends="required">
<arg key="registerForm.user" bundle="errorMessages"/>
</field>
<field property="password" depends="required">
<arg key="registerForm.password" bundle="errorMessages" />
</field>
</form>
</formset>

I switched between the bundles and despite the fact that both work well if i use them with struts tags, there's no way to make them work with validation. The only way i found to run it correctly was declaring a <message-resources> element without key and it works, but i suppose that it may work using keys to identify different <message-resources> (it looks more clear)

Has anybody some ideas about that?
Thanks to everybody
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic