家长:
@ExceptionHandler(NoUserException.class)
protected ModelAndView handleException(NoUserException e) {
Map<String, Object> model = new HashMap<String, Object>();
model.put(ModelKeys.HOST_KEY, "message");
return new ModelAndView("noAccess",model);
}
孩子:
@ExceptionHandler(NoUserException.class)
protected void handleException(NoUserException e, HttpServletRequest request, HttpServletResponse response) throws IOException {
logger.error("Invalid user.");
respond(CLIENT_USER_ERROR,response);
}
是的,我确实需要它们具有不同的参数和输出。