Resources not being loaded for javascript validation on the first time
----------------------------------------------------------------------

                 Key: WW-2410
                 URL: https://issues.apache.org/struts/browse/WW-2410
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.0.11
            Reporter: Mike M.
            Priority: Minor


Example:

org/bogus/controller/SelfRegister.java is the action class

org/bogus/controller/SelfRegister-validation.xml contains the validation 
configs:
        <field name="emailAddress">
                <field-validator type="requiredstring">
                        <message key="errors.required">required</message>
                </field-validator>
        </field>

org/bogus/controller/SelfRegister.properties contains the field labels for this 
specific action/form:
emailAddress=Email address

WEB-INF/classes/ApplicationResources.properties contains default props for all 
actions:
errors.required=${getText(fieldName)} is a required field.

When my form does javascript validation (validate=true), the first time you 
leave emailAddress empty, it doesn't appear to be looking up the field name 
from SelfRegister.properties, although it does get the error message from 
ApplicationResources.properties properly, so you see:

emailAddress is a required field.

My form just happens to have other fields and validations on it too and some of 
them don't actually have javascript validations (e.g. it appears that 
expression validations don't do javascript; they have to call the back end).  
So by first time, I mean if you leave emailAddress blank once you don't see the 
proper label in the error message and if you fill it in and trigger the 
"expression validator" on a separate field which causes (back end) java 
validation to happen, it will then load the proper labels from the 
SelfRegister.properties file.  So from that point onward if you leave 
emailAddress empty, you will see the proper message:

Email address is a required field.

If you need further explanation please let me know.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to