Package com.aspectran.web.support.etag
Class ETagInterceptor
- java.lang.Object
-
- com.aspectran.web.support.etag.ETagInterceptor
-
public class ETagInterceptor extends java.lang.Object
Etag interceptor to enable If-None-Match request with ETAG support. If the ETag generated for each request matches the value in the If-None-Match header, an empty response with status code 304 (not modified) is sent to the client.- Since:
- 6.9.4
-
-
Constructor Summary
Constructors Constructor Description ETagInterceptor(ETagTokenFactory tokenFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
generateETagToken(Translet translet, boolean isWeak)
void
intercept(Translet translet)
boolean
isWriteWeakETag()
Return whether the ETag value written to the response should be weak, as per RFC 7232.void
setWriteWeakETag(boolean writeWeakETag)
Set whether the ETag value written to the response should be weak, as per RFC 7232.
-
-
-
Constructor Detail
-
ETagInterceptor
public ETagInterceptor(@NonNull ETagTokenFactory tokenFactory)
-
-
Method Detail
-
setWriteWeakETag
public void setWriteWeakETag(boolean writeWeakETag)
Set whether the ETag value written to the response should be weak, as per RFC 7232.- See Also:
- RFC 7232 section 2.3
-
isWriteWeakETag
public boolean isWriteWeakETag()
Return whether the ETag value written to the response should be weak, as per RFC 7232.
-
intercept
public void intercept(Translet translet)
-
generateETagToken
protected java.lang.String generateETagToken(Translet translet, boolean isWeak)
-
-