Package org.springframework.web.servlet.handler

Examples of org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext()


  @Test
  public void concreteUrlMappings() {
    SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
    mapping.setUrlMap(Collections.singletonMap("/foo", new Object()));
    mapping.setApplicationContext(new StaticApplicationContext());
    mapping.initApplicationContext();
    this.endpoint.setHandlerMappings(Collections
        .<AbstractUrlHandlerMapping> singletonList(mapping));
    Map<String, Object> result = this.endpoint.invoke();
    assertEquals(1, result.size());
    @SuppressWarnings("unchecked")
View Full Code Here


  public void beanUrlMappings() {
    StaticApplicationContext context = new StaticApplicationContext();
    SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
    mapping.setUrlMap(Collections.singletonMap("/foo", new Object()));
    mapping.setApplicationContext(context);
    mapping.initApplicationContext();
    context.getDefaultListableBeanFactory().registerSingleton("mapping", mapping);
    this.endpoint.setApplicationContext(context);
    Map<String, Object> result = this.endpoint.invoke();
    assertEquals(1, result.size());
    @SuppressWarnings("unchecked")
View Full Code Here

    controllerHandlerMapping.reload();

    // Update the resource handler mapping
    SimpleUrlHandlerMapping resourceHandlerMapping = resourceHandlerMapping();
    resourceHandlerMapping.setUrlMap( resourceHandlerRegistry.getUrlMap() );
    resourceHandlerMapping.initApplicationContext();

    // Handler exception resolver
    if ( exceptionResolvers.isEmpty() ) {
      addDefaultHandlerExceptionResolvers( exceptionResolvers, contentNegotiationManager, messageConverters );
    }
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.