Struts validator in multiple module applications

W

wmilus

I have validation framework working for my 2 module application,
struts 1.1, but I cannot get the argument values to display when i
use <arg0 key"somekey"/> in the formset/form/field validation block.
I debug into the commons validator code and the problem is that the
ValidatorResources is null and produces no entries in the arg array -
it is apparently not finding the resource for the key specified in the
validation.xml file.

I need the argN values to be internationalized hence I need to use
resource keys.

resource file - application.properties
errors.required={0} is required.
testwords = application test

validation.xml segment:
<form name="UserAccountForm">
<field property="lastName" depends="required">
<arg0 key="testwords" resource="true" />
</field>
</form>

test.jsp - with struts-html tag
<html:html locale="true">
........
<html:errors />
........
</html>

The display shows:
is required.

I wanted display to show:
application test is required.

It appears to me as though the validator is not handling the multiple
module resources correctly. I already know that I cannot specify a
bundle for the msg or argN values.

Does anyone know a solution to this?

If I cannot use the validator framework then I will be forced to write
validation calls into my forms.
Thanks
W Milus
 
W

wmilus

Eki Y. Baskoro said:

The tag in my sample snippet is wrong - the actual tag is </html:html>
The problem isn't with jsp rendering.
I placed a validate() override method in my form code to see what the
validator returns. The errors collection contains one entry - the
value is the msg value from errors.required entry. good
The problem is that the arg0 value doesn't get filled in from any of
the resource files.
Hope that's clear and thanks for your reply.
Bill
 
S

Sudsy

wmilus said:
The tag in my sample snippet is wrong - the actual tag is </html:html>
The problem isn't with jsp rendering.
I placed a validate() override method in my form code to see what the
validator returns. The errors collection contains one entry - the
value is the msg value from errors.required entry. good
The problem is that the arg0 value doesn't get filled in from any of
the resource files.
Hope that's clear and thanks for your reply.
Bill

So did you read the article? All of that information has been
double-checked and confirmed by testing. Of course without
seeing your actual configuration...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top