-
Couldn't load subscription status.
- Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
Kazuki Shimizu opened SPR-13546 and commented
Currently, when i want to add a object into the Model, i implements as returning the ModelAndView object from @ExceptionHandler method as follow.
@ExceptionHandler
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public ModelAndView handleException(Exception e) {
ModelAndView mav = new ModelAndView("error/systemError");
mav.getModelMap().addAttribute("message", e.getMessage());
return mav;
}I want to use the Model at @ExceptionHandler method argument instead of ModelAndView by default as follow.
@ExceptionHandler
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public String handleException(Exception e, Model model) {
model.addAttribute("message", e.getMessage());
return "error/systemError";
}How do think ?
I submit PR at later.
Affects: 4.2.1
Referenced from: pull request #883, and commits 4391b29, 44b76d3
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement