Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can it resolve response(mv) according to request uri #12

Open
weaponready opened this issue Dec 6, 2015 · 2 comments
Open

can it resolve response(mv) according to request uri #12

weaponready opened this issue Dec 6, 2015 · 2 comments

Comments

@weaponready
Copy link

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

@hanprat
Copy link

hanprat commented Mar 11, 2016

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.

@erdosam
Copy link

erdosam commented Mar 11, 2016

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();
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants