struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris <christal...@yahoo.fr>
Subject Re: 2.3.16.3 Color in error message ( Authenticate Login )
Date Wed, 04 Jun 2014 16:27:01 GMT

In the screen, with struts2examples/form_validation 

the dynamics tag are :
<tr errorFor="register_personBean_firstName">
<td align="center" valign="top" colspan="2"><span class="errorMessage">First name
is required.</span></td></tr><tr>
<td class="tdLabel">
<label for="register_personBean_firstName" class="errorLabel">First name:</label></td><td



Le Mercredi 4 juin 2014 18h13, Chris <christalkto@yahoo.fr> a écrit :
 


Hello, 


I don't find in the strutsexamples ( 6 form_validation, 7 message_ressource...etc) where I
could write red color when error message is displayed in loginForm.jsp


First the validator LoginAction-validation.xml works fine with required fields.


Then the authentication with LoginAction works or not. 


But I would like to write red error when the authentication fails.

...
    public void validate() {
        if (userName.length() != 0 && password.length() != 0 && !(AuthenticateUser(userName,
password))) {
            addFieldError("userName", " The Identification has failed"); 
        }
    }

When the Authenticate fails, the message works with "The Identification has failed" , but
the color is not red in the loginForm.jsp...


Regards

Chris
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message