Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyWebApplicationInitializer implements WebApplicationInitializer {
- @Override
- public void onStartup(ServletContext servletCxt) {
- // Load Spring web application configuration
- AnnotationConfigWebApplicationContext ac = new AnnotationConfigWebApplicationContext();
- ac.register(AppConfig.class);
- ac.refresh();
- // Create and register the DispatcherServlet
- DispatcherServlet servlet = new DispatcherServlet(ac);
- ServletRegistration.Dynamic registration = servletCxt.addServlet("app", servlet);
- registration.setLoadOnStartup(1);
- registration.addMapping("/app/*");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement