You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Akbar Ibrahim <ak...@wipro.com> on 2004/10/05 14:52:22 UTC
Missing resources - Struts 1.2.4 + Validator + Multiple Modules
Hi,
I have a Struts 1.2.4 application with multiple modules. I am using the Struts
Validator plugin to validate my forms. I have defined the Validator plugin in
the default Struts config file as well as the module specific struts config
file. The validator-rules.xml file is common across all modules. I am using
separate validation.xml files for each module. I am also using separate message
resources for each module (saved under different keys) along with the default
message resources.
In one of my modules, the validation.xml file contains the following form
definition...
<form name="someForm">
<field property="someProperty" depends="required">
<arg position="0"
bundle="resources.moduleX"
key="label.someProperty" />
</field>
</form>
label.someProperty is defined as 'Some Property' in the resource bundle
resources.moduleX
Now when this form is submitted without specifying any value for the
property 'someProperty'. I expect to see a message 'Some Property is required'.
But all I see is 'is required'. The resource is not being fetched.
The Validator developer guide in the Struts documentation says...
----------
Note that as of the Struts 1.1 release, you must explicitly define your message
resource in any module that is going to use the Validator, due to a problem
accessing the top-level resource. This only effects applications which are
using modules.
----------
I take this to mean that message resources (stored under the default bundle
key) must be defined in every module. And if my 'arg' element didn't specify
a 'bundle' attribute, the resource would be keyed out of the default resource
bundle.
This also means that the 'bundle' attribute in the 'arg' element doesn't work
as it should.
A Bug?
Can someone through some light one this. Am I doing something wrong.
Regards,
Akbar
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org