Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public class MyWebApplicationInitializer implements WebApplicationInitializer {
  2.  
  3. @Override
  4. public void onStartup(ServletContext servletCxt) {
  5.  
  6. // Load Spring web application configuration
  7. AnnotationConfigWebApplicationContext ac = new AnnotationConfigWebApplicationContext();
  8. ac.register(AppConfig.class);
  9. ac.refresh();
  10.  
  11. // Create and register the DispatcherServlet
  12. DispatcherServlet servlet = new DispatcherServlet(ac);
  13. ServletRegistration.Dynamic registration = servletCxt.addServlet("app", servlet);
  14. registration.setLoadOnStartup(1);
  15. registration.addMapping("/app/*");
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement