Examples of AnnotationConfigWebApplicationContext


Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

public class ApplicationInitializer implements WebApplicationInitializer {

  @Override
  public void onStartup(ServletContext servletContext) throws ServletException {
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.register(ApplicationConfiguration.class);
    rootContext.setDisplayName("Movie database");
    servletContext.addListener(new ContextLoaderListener(rootContext));
    ServletRegistration.Dynamic dispatcher =
        servletContext.addServlet("dispatcher", new DispatcherServlet(rootContext));
    dispatcher.setLoadOnStartup(1);
    dispatcher.addMapping("/");
View Full Code Here

Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

   * @param configClasses
   * @return
   */
  public static WebApplicationContext createApplicationContext(Class<?>... configClasses) {

    AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
    context.setServletContext(new MockServletContext());

    for (Class<?> configClass : configClasses) {
      context.register(configClass);
    }

    context.refresh();

    return context;
  }
View Full Code Here

Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

    private static final String DISPATCHER_SERVLET_NAME = "dispatcher";
    private static final String DISPATCHER_SERVLET_MAPPING = "/";

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
        rootContext.register(ExampleApplicationContext.class);

        //XmlWebApplicationContext rootContext = new XmlWebApplicationContext();
        //rootContext.setConfigLocation("classpath:exampleApplicationContext.xml");

        ServletRegistration.Dynamic dispatcher = servletContext.addServlet(DISPATCHER_SERVLET_NAME, new DispatcherServlet(rootContext));
View Full Code Here

Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

    private static final String DISPATCHER_SERVLET_NAME = "dispatcher";
    private static final String DISPATCHER_SERVLET_MAPPING = "/";

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
        rootContext.register(ExampleApplicationContext.class);

        //XmlWebApplicationContext rootContext = new XmlWebApplicationContext();
        //rootContext.setConfigLocation("classpath:exampleApplicationContext.xml");

        ServletRegistration.Dynamic dispatcher = servletContext.addServlet(DISPATCHER_SERVLET_NAME, new DispatcherServlet(rootContext));
View Full Code Here

Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

public class BitcoinServletInitializer implements WebApplicationInitializer {

  public void onStartup(ServletContext servletContext) throws ServletException {

    AnnotationConfigWebApplicationContext cxt = new AnnotationConfigWebApplicationContext();
    cxt.register(ServerConfig.class);

    DispatcherServlet servlet = new DispatcherServlet(cxt);
    ServletRegistration.Dynamic dispatcher = servletContext.addServlet("main", servlet);
    dispatcher.setLoadOnStartup(1);
    dispatcher.setAsyncSupported(true);
View Full Code Here

Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

public class BitcointWebAppInitializer implements WebApplicationInitializer {

  public void onStartup(ServletContext servletContext) throws ServletException {

    AnnotationConfigWebApplicationContext webAppContext = new AnnotationConfigWebApplicationContext();
        webAppContext.register(WebConfig.class);

        final DispatcherServlet dispatcherServlet = new DispatcherServlet(webAppContext);

        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcherServlet", dispatcherServlet);
        dispatcher.setLoadOnStartup(1);
View Full Code Here

Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

public class BitcointWebAppInitializer implements WebApplicationInitializer {

  public void onStartup(ServletContext servletContext) throws ServletException {

    AnnotationConfigWebApplicationContext webAppContext = new AnnotationConfigWebApplicationContext();
    webAppContext.register(WebConfig.class);

    final DispatcherServlet dispatcherServlet = new DispatcherServlet(webAppContext);

    @SuppressWarnings("serial")
    MeteorServlet meteorServlet = new MeteorServlet() {
View Full Code Here

Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

     * {@inheritDoc}
     */
    public void onStartup(ServletContext servletContext) throws ServletException {

        // creates the web app context
        AnnotationConfigWebApplicationContext webContext = new AnnotationConfigWebApplicationContext();
        webContext.register(WebAppConfig.class);

        // registers context load listener
        servletContext.addListener(new ContextLoaderListener(new AnnotationConfigWebApplicationContext()));

        // adds a dispatch servlet, the servlet will be configured from root web app context
        ServletRegistration.Dynamic servletConfig = servletContext.addServlet("employee",
                new DispatcherServlet(webContext));
        servletConfig.setLoadOnStartup(1);
View Full Code Here

Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

     * {@inheritDoc}
     */
    public void onStartup(ServletContext servletContext) throws ServletException {

        // creates the web root app context
        AnnotationConfigWebApplicationContext webRootContext = new AnnotationConfigWebApplicationContext();
        webRootContext.register(WebAppConfig.class);

        // registers context load listener
        servletContext.addListener(new ContextLoaderListener(webRootContext));

        // adds a dispatch servlet, the servlet will be configured from root web app context
        ServletRegistration.Dynamic servletConfig = servletContext.addServlet("employee",
                new DispatcherServlet(new AnnotationConfigWebApplicationContext()));
        servletConfig.setLoadOnStartup(1);
        servletConfig.addMapping("*.htm");
    }
View Full Code Here

Examples of org.springframework.web.context.support.AnnotationConfigWebApplicationContext

     */
    public final void onStartup(ServletContext servletContext)
            throws ServletException {
        beforeSpringSecurityFilterChain(servletContext);
        if(configurationClasses != null) {
            AnnotationConfigWebApplicationContext rootAppContext = new AnnotationConfigWebApplicationContext();
            rootAppContext.register(configurationClasses);
            servletContext.addListener(new ContextLoaderListener(rootAppContext));
        }
        if(enableHttpSessionEventPublisher()) {
            servletContext.addListener("org.springframework.security.web.session.HttpSessionEventPublisher");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.