Package org.springframework.web.servlet.handler

Examples of org.springframework.web.servlet.handler.SimpleUrlHandlerMapping


      private ResourceLoader resourceLoader;

      @Bean
      public SimpleUrlHandlerMapping faviconHandlerMapping() {
        SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
        mapping.setOrder(Integer.MIN_VALUE + 1);
        mapping.setUrlMap(Collections.singletonMap("**/favicon.ico",
            faviconRequestHandler()));
        return mapping;
      }
View Full Code Here


  private RequestMappingEndpoint endpoint = new RequestMappingEndpoint();

  @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

  }

  @Test
  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

    @Test
    public void testGeoServerConsoleDisabledTrue() throws Exception {
        // when the console is disabled the filePublisher method is used -- this
        // fetches files instead of delegating requests to wicket
        SimpleUrlHandlerMapping mapping = getWebDispatcherMapping(true);
       
        assertEquals(mapping.getUrlMap().get(WEB_MAPPING),
                CONSOLE_DISABLED_PUBLISHER);
        assertEquals(mapping.getUrlMap().get(WEB_WILDCARD_MAPPING),
                CONSOLE_DISABLED_PUBLISHER);
        assertEquals(mapping.getUrlMap().get(WEB_RESOURCES_WILDCARD_MAPPING),
                CONSOLE_DISABLED_PUBLISHER);
    }
View Full Code Here

    @Test
    public void testGeoserverConsoleDisabledFalse() throws Exception {
        // with the console enabled (default) requests are passed to wicket and
        // the gui is displayed
        SimpleUrlHandlerMapping mapping = getWebDispatcherMapping(false);
       
        assertEquals(mapping.getUrlMap().get(WEB_MAPPING),
                CONSOLE_ENABLED_PUBLISHER);
        assertEquals(mapping.getUrlMap().get(WEB_WILDCARD_MAPPING),
                CONSOLE_ENABLED_PUBLISHER);
        assertEquals(mapping.getUrlMap().get(WEB_RESOURCES_WILDCARD_MAPPING),
                CONSOLE_ENABLED_PUBLISHER);
    }
View Full Code Here

    controllerHandlerMapping.setInterceptors( interceptorRegistry.getInterceptors().toArray() );

    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

  }

  @Bean
  @Exposed
  public SimpleUrlHandlerMapping resourceHandlerMapping() {
    return new SimpleUrlHandlerMapping();
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.handler.SimpleUrlHandlerMapping

Copyright © 2018 www.massapicom. 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.