Java Code Examples for org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry#hasMappingForPattern()
The following examples show how to use
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry#hasMappingForPattern() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 2
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 3
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 4
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching .setCachePeriod(0)//Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 5
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching .setCachePeriod(0)//Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 6
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 7
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 8
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 9
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 10
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 11
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 12
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 13
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 14
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching .setCachePeriod(0)//Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 15
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 16
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 17
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 18
Source File: WebMvcConfig.java From Spring-Security-Third-Edition with MIT License | 6 votes |
@Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/") .setCachePeriod(0) //Set to 0 in order to send cache headers that prevent caching ; // Add WebJars for Bootstrap & jQuery if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/").resourceChain(true); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations( CLASSPATH_RESOURCE_LOCATIONS); } }
Example 19
Source File: WebMvcConfig.java From taskana with Apache License 2.0 | 5 votes |
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { if (!registry.hasMappingForPattern("/webjars/**")) { registry .addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/"); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS); } }
Example 20
Source File: SwaggerUiConfiguration.java From openapi-generator with Apache License 2.0 | 5 votes |
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { if (!registry.hasMappingForPattern("/webjars/**")) { registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); } if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); } }