Add checkNotModified support for view resolution

Issue: SPR-14522
This commit is contained in:
Rossen Stoyanchev
2016-09-01 18:07:23 -04:00
parent 6071e01168
commit 0681519255
5 changed files with 45 additions and 2 deletions

View File

@@ -68,6 +68,12 @@ public interface ServerWebExchange {
*/
Mono<WebSession> getSession();
/**
* Returns {@code true} if the one of the {@code checkNotModified} methods
* in this contract were used and they returned true.
*/
boolean isNotModified();
/**
* An overloaded variant of {@link #checkNotModified(String, Instant)} with
* a last-modified timestamp only.

View File

@@ -104,6 +104,11 @@ public class DefaultServerWebExchange implements ServerWebExchange {
return this.sessionMono;
}
@Override
public boolean isNotModified() {
return this.notModified;
}
@Override
public boolean checkNotModified(Instant lastModified) {
return checkNotModified(null, lastModified);