lee3star
Jul 16th, 2007, 10:29 AM
Hi guys,
I'm a newbie just from Struts to Spring2.
In my controller class, I have the following code adding a global error:
try {
user = userService.authenticate(form.getLoggingName(), form.getPassword());
} catch (UserAuthenticationException e) {
errors.reject(e.getMessage());
form.setPassword(null);
request.setAttribute(getCommandName(), form);
return new ModelAndView(getFormView());
}
The question is how to display the error in jsp page?
I have tried:
1) <form:errors />
2) <form:errors path="commandName" />
but no luck.
Can anyone give me a hint on this??
Any input is welcome. thanks.
I'm a newbie just from Struts to Spring2.
In my controller class, I have the following code adding a global error:
try {
user = userService.authenticate(form.getLoggingName(), form.getPassword());
} catch (UserAuthenticationException e) {
errors.reject(e.getMessage());
form.setPassword(null);
request.setAttribute(getCommandName(), form);
return new ModelAndView(getFormView());
}
The question is how to display the error in jsp page?
I have tried:
1) <form:errors />
2) <form:errors path="commandName" />
but no luck.
Can anyone give me a hint on this??
Any input is welcome. thanks.