Skip to content

Add RedirectAttributesMethodArgumentResolver to the default argument resolvers in ExceptionHandlerExceptionResolver [SPR-14651] #19217

@spring-projects-issues

Description

@spring-projects-issues

Brian Clozel opened SPR-14651 and commented

Without an instance of a RedirectAttributesMethodArgumentResolver configured in the list of default argument resolvers in ExceptionHandlerExceptionResolver, the following exception handling method signature is not possible:

@ExceptionHandler(MyCustomException.class)
public String handleMyCustomExceptions(MyCustomException exc, RedirectAttributes redirectAttributes) {
        redirectAttributes.addFlashAttribute("errorMessage", "My Custom error message");
        return "redirect:/viewName";
}

Reference URL: http://stackoverflow.com/questions/14961869/performing-a-redirect-from-a-spring-mvc-exceptionhandler-method/

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions