类 StaticResourceRequest
- java.lang.Object
- org.springframework.boot.autoconfigure.security.servlet.StaticResourceRequest
public final class StaticResourceRequest extends Object
Used to create aRequestMatcher
for static resources in commonly used locations. Returned byPathRequest.toStaticResources()
.- 从以下版本开始:
- 2.0.0
- 另请参阅:
PathRequest
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
StaticResourceRequest.StaticResourceRequestMatcher
The request matcher used to match against resourceLocations
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StaticResourceRequest.StaticResourceRequestMatcher
at(Set<StaticResourceLocation> locations)
Returns a matcher that includes the specifiedLocations
.StaticResourceRequest.StaticResourceRequestMatcher
at(StaticResourceLocation first, StaticResourceLocation... rest)
Returns a matcher that includes the specifiedLocations
.StaticResourceRequest.StaticResourceRequestMatcher
atCommonLocations()
Returns a matcher that includes all commonly usedLocations
.
方法详细资料
atCommonLocations
public StaticResourceRequest.StaticResourceRequestMatcher atCommonLocations()
Returns a matcher that includes all commonly usedLocations
. Theexcluding
method can be used to remove specific locations if required. For example:PathRequest.toStaticResources().atCommonLocations().excluding(StaticResourceLocation.CSS)
- 返回:
- the configured
RequestMatcher
at
public StaticResourceRequest.StaticResourceRequestMatcher at(StaticResourceLocation first, StaticResourceLocation... rest)
Returns a matcher that includes the specifiedLocations
. For example:PathRequest.toStaticResources().at(StaticResourceLocation.CSS, StaticResourceLocation.JAVA_SCRIPT)
- 参数:
first
- the first location to includerest
- additional locations to include- 返回:
- the configured
RequestMatcher
at
public StaticResourceRequest.StaticResourceRequestMatcher at(Set<StaticResourceLocation> locations)
Returns a matcher that includes the specifiedLocations
. For example:PathRequest.toStaticResources().at(locations)
- 参数:
locations
- the locations to include- 返回:
- the configured
RequestMatcher