Hi,

I am using struts in my application. to validate users entry in jsp i have
my validation method. and i am calling that method in action class. code is
below:(I am not using struts' validations )

//  in action class, calling validate method
ActionErrors errors = myForm.validate(mapping,request);


//In form bean
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
        ActionErrors errors = new ActionErrors();
        if(("".equals(name.trim()))){
            errors.add(name, new ActionError("myForm.Name"));
        }
        if(("".equals(address.trim()))){
            errors.add(address, new ActionError("myForm.address"));
        }
        return errors;
    }



// in action class checking is errors are empty
if (!errors.isEmpty()) {
    saveErrors(request, errors);
    return mapping.findForward("ADD");
}


above code is working fine. Only problem is it is printing error messages in
jsp in one line.

example: Enter Name. Enter Address.


I would like to show every error message on new line in jsp. is it possible.


in jsp i am using <html:errors/> to print message.


thank you for your time and solutions

Reply via email to