You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by elisegev1 <el...@yahoo.com> on 2004/12/22 01:21:20 UTC

Validation Failure

I am learning how to use Struts and have encountered the following 
problem.  I have a form bean defined as 'DynaActionForm' with 
properties defined in struts-config.xml.  In validation.xml I specify 
the validation rules for some of the properties - not all. The source 
code for the generated page has the following generated Javascript 
function:

    function submitForm_required () { 
     this.a0 = new Array("property1", "", new Function ("varName", " 
return this[varName];"));
     this.a1 = new Array("property2", "", new Function ("varName", " 
return this[varName];"));
     this.a2 = new Array("property3", "", new Function ("varName", " 
return this[varName];"));
    } 

The error message should appear in the second argument of the 'new 
Array', but does not.  Does anyone know what causes this error?  If I 
put any of the error messages as a 'message' in the Jsp file, the 
message does appear correctly.  Which means that my resource file is 
read by the system.  Yet the error messages are missing.  Any 
suggestions on how to debug this problem?

BTW, the Javascript alert does pop up when it should, but it appears 
empty without the error messages.


-----------

Eli 




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validation Failure

Posted by Cliff <cl...@reinfo.com.hk>.
displaying the message in jsp != it can read in the Validator

I also encountered this problem before.

Cliff

--- In struts@yahoogroups.com, "elisegev1" <el...@y...> wrote:
> 
> I am learning how to use Struts and have encountered the following 
> problem.  I have a form bean defined as 'DynaActionForm' with 
> properties defined in struts-config.xml.  In validation.xml I 
specify 
> the validation rules for some of the properties - not all. The 
source 
> code for the generated page has the following generated Javascript 
> function:
> 
>     function submitForm_required () { 
>      this.a0 = new Array("property1", "", new Function 
("varName", " 
> return this[varName];"));
>      this.a1 = new Array("property2", "", new Function 
("varName", " 
> return this[varName];"));
>      this.a2 = new Array("property3", "", new Function 
("varName", " 
> return this[varName];"));
>     } 
> 
> The error message should appear in the second argument of the 'new 
> Array', but does not.  Does anyone know what causes this error?  
If I 
> put any of the error messages as a 'message' in the Jsp file, the 
> message does appear correctly.  Which means that my resource file 
is 
> read by the system.  Yet the error messages are missing.  Any 
> suggestions on how to debug this problem?
> 
> BTW, the Javascript alert does pop up when it should, but it 
appears 
> empty without the error messages.
> 
> 
> -----------
> 
> Eli 
> 
> 
> 
> 
> -------------------------------------------------------------------
--
> To unsubscribe, e-mail: user-unsubscribe@s...
> For additional commands, e-mail: user-help@s...




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org