You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my services work for both rest api (like /api/v1/** ) controllers and dashboard(/admin/**) controllers, they share the same exceptions.
what I expect is :when i requesting dashboard url , is should not handled by rest exception handlers but show the error.jsp
The text was updated successfully, but these errors were encountered:
Hi, @weaponready. Have you solve the issue? I really face this problem too. Handling exception for only REST controllers, and let other exception handled by default.
I don't know if this solve the problem. But, I set the 'default' to false.
@Bean
public RestHandlerExceptionResolver restExceptionResolver() {
return RestHandlerExceptionResolver.builder()
// make the handler just handling the added handlers. Sorry my bad english
.withDefaultHandlers(false)
.withDefaultMessageSource(false)
// ---
.messageSource(httpErrorMessageSource())
.defaultContentType(MediaType.APPLICATION_JSON)
.addErrorMessageHandler(TeaPotException.class, HttpStatus.I_AM_A_TEAPOT)
...
.build();
}
my services work for both rest api (like /api/v1/** ) controllers and dashboard(/admin/**) controllers, they share the same exceptions.
what I expect is :when i requesting dashboard url , is should not handled by rest exception handlers but show the error.jsp
The text was updated successfully, but these errors were encountered: