Hi,
As I am new to Struts v1.1 ...I want to display error messages in my jsp according to
validation ,The errors are as in my LoginForm The validatoin method code for Loginform
is as below...and I am using Applicationresources.properties file also...So what
should I need to code in my jsp..and LoginForm Please !!!! If there is any code
snippet pl. forward me..
****************************************************************************
public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
try {
System.out.println(
"old password ======================" + currentPassword);
if (currentPassword == null || currentPassword.length() == 0) {
errors.add(
"currentPassword",
new ActionError("errors.changepasswordForm.currentPassword.required"));
}
if (newPassword == null || currentPassword.length() == 0) {
errors.add(
"newPassword",
new ActionError("errors.changepasswordForm.newPassword.required"));
}
if (confirmPassword == null || currentPassword.length() == 0) {
errors.add(
"confirmNewPassword",
new ActionError("errors.changepasswordForm.confirmPassword.required"));
} else if (
currentPassword.length() > 0 && currentPassword.length() < 7) {
errors.add(
"currentPassword",
new ActionError("errors.changepasswordForm.currentPassword.lessthanseven"));
}
if (newPassword.length() > 0 && newPassword.length() < 7) {
errors.add(
"newPassword",
new ActionError("errors.changepasswordForm.newPassword.lessthanseven"));
}
} catch (Exception e) {
//e.printStackTrace();
}
return errors;
}
Please give me u'r suggestion to display errors in my jsp as per validations..
Cheer's
Dhanu.
CEI-India Pvt. Ltd.,