package org.jboss.arquillian.spring.testsuite.beans.web;
import org.jboss.arquillian.spring.testsuite.beans.config.WebAppConfig;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
public void onStartup(ServletContext servletContext)
throws ServletException {
AnnotationConfigWebApplicationContext webContext = new AnnotationConfigWebApplicationContext();
webContext.register(WebAppConfig.class);
servletContext.addListener(new ContextLoaderListener(new AnnotationConfigWebApplicationContext()));
ServletRegistration.Dynamic servletConfig = servletContext.addServlet("employee",
new DispatcherServlet(webContext));
servletConfig.setLoadOnStartup(1);
servletConfig.addMapping("*.htm");
}
}