List of usage examples for javax.servlet ServletRegistration.Dynamic getInitParameter
public String getInitParameter(String name);
From source file:net.ljcomputing.sr.config.StatusReporterWebConfiguration.java
/** * @see org.springframework.boot.context.web.SpringBootServletInitializer#onStartup(javax.servlet.ServletContext) *///from w w w. ja v a 2 s . c o m public void onStartup(ServletContext container) throws ServletException { logger.info("onStartup ..."); AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext(); ctx.register(StatusReporterWebConfiguration.class); ctx.setServletContext(container); DispatcherServlet ds = new DispatcherServlet(ctx); ServletRegistration.Dynamic servlet = container.addServlet("dispatcherServlet", ds); servlet.setInitParameter("throwExceptionIfNoHandlerFound", "true"); servlet.setLoadOnStartup(1); servlet.addMapping("/"); logger.warn("servlet name: {}", servlet.getName()); logger.warn("servlet throwExceptionIfNoHandlerFound: {}", servlet.getInitParameter("throwExceptionIfNoHandlerFound")); }