Hi, 
   
  Am not using validator.xml for validation.  But just the Actionform validate 
method to validate the username and password submitted without values.  I tried 
to use even ActionMessage in place of ActionError, but, my jsp is not showing 
the error message.  
  Please Help.
   
  Thank and Regards,
  MSV Lakshmi.

Pankaj Gupta <[EMAIL PROTECTED]> wrote:
  Use ActionMessages in place of ActionErrors.
See:
http://wiki.apache.org/struts/StrutsUpgradeNotes11to124

regards,
Pankaj

[EMAIL PROTECTED] wrote:
> Hi,
>
> public ActionErrors validate(ActionMapping actionMapping,
> HttpServletRequest httpServletRequest) {
>
> ActionErrors errors = new ActionErrors();
>
>
> if ((username == null) || (username.length() == 0)) {
> errors.add("username", new
> 
> org.apache.struts.action.ActionError("error.login.username"));
> }
> 
> if ((password == null) || (password.length() == 0)) {
> errors.add("password", new
> 
> org.apache.struts.action.ActionError("error.login.password"));
> }
> 
> 
> return errors;
> }
>
> Add this code in your formbean. Ur formbean should extend ValidatorForm.
>
> In Jsp. Add this code in the jsp. It will be validation
> will be displayed.
>
>
> regards,
>
> Mansoor 
>
> 
>
> 
>
>
> -----Original Message-----
> From: Medicherla Lakshmi [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 20, 2006 6:16 PM
> To: Struts Users Mailing List
> Subject: ActionErrors not being displayed in jsp
>
>
>
> HI,
> 
> Can anyone please explain me how to validate a login page using
> validate method of actionform. Am not able to display the errors in my
> jsp page though i wrote in my jsp. Please give any
> example of using ActionErrors.
> 
> Thanks and Regards,
> MSV Lakshmi.
>
> 
> ---------------------------------
> Yahoo! India Answers: Share what you know. Learn something new Click
> here
> Send free SMS to your Friends on Mobile from your Yahoo! Messenger
> Download now
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



                                
---------------------------------
  Yahoo! India Answers: Share what you know. Learn something new Click here
 Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now

Reply via email to