Tuesday, April 5, 2011

Spring custom error message

I want to set a custom error message via @Controller, there is something like Struts saveMessages(...) in spring?

for example:

ActionErrors actionErrors = new ActionErrors();
actionErrors.add("error", new ActionMessage("error.missing.key",     
messageResources.getMessage("label.username"),  
messageResources.getMessage("label.password")));
saveErrors(request, actionErrors);
From stackoverflow

0 comments:

Post a Comment