Skip to content

ErrorController w/ servlet mappings Question #936

@justinmusgrove

Description

@justinmusgrove

Hey folks, great job on boot and it is nice to see how it is changing how we are organizing projects in the enterprise.

We have a requirement where we have multiple servlet mappings pointing to dispatch servlet due to security infrastructure reasons so we modified dispatchservlet as follows:

@Configuration
@ComponentScan
@EnableAutoConfiguration
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public DispatcherServlet dispatcherServlet() {
        return new DispatcherServlet();
    }

    @Bean
    public ServletRegistrationBean dispatcherServletRegistration() {

        ServletRegistrationBean registration = new ServletRegistrationBean(
                dispatcherServlet(), "/audience1/*", "/audience2/*");

        registration
                .setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME);

        return registration;
    }

}

Similar to what is described #91 when we do this the BasicErrorController is mapped to /audience1/error or /audience2/error. When an error occurs, it doesn't trigger to the error process but it does mapping of /error. Thoughts on how to handle this?

boot version: 1.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions