Package com.vaadin.flow.spring.security
Class VaadinDefaultRequestCache
- java.lang.Object
-
- com.vaadin.flow.spring.security.VaadinDefaultRequestCache
-
- All Implemented Interfaces:
org.springframework.security.web.savedrequest.RequestCache
@Component public class VaadinDefaultRequestCache extends Object implements org.springframework.security.web.savedrequest.RequestCache
A default request cache implementation which aims to ignore requests that are not for routes.For the requests that are not ignored, delegates the actual saving to the other
RequestCacheinstance. Uses an internalHttpSessionRequestCachefor delegating to, unless a custom delegate is set using thesetDelegateRequestCache(RequestCache)method.Using this class helps with redirecting the user to the correct route after login instead of redirecting to some internal URL like a service worker or some data the service worker has fetched.
-
-
Constructor Summary
Constructors Constructor Description VaadinDefaultRequestCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.servlet.http.HttpServletRequestgetMatchingRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)org.springframework.security.web.savedrequest.SavedRequestgetRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidremoveRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidsaveRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidsetDelegateRequestCache(org.springframework.security.web.savedrequest.RequestCache delegateRequestCache)Sets the cache implementation that is used for the actual saving of the requests that are not ignored.
-
-
-
Method Detail
-
saveRequest
public void saveRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)- Specified by:
saveRequestin interfaceorg.springframework.security.web.savedrequest.RequestCache
-
getRequest
public org.springframework.security.web.savedrequest.SavedRequest getRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)- Specified by:
getRequestin interfaceorg.springframework.security.web.savedrequest.RequestCache
-
getMatchingRequest
public javax.servlet.http.HttpServletRequest getMatchingRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)- Specified by:
getMatchingRequestin interfaceorg.springframework.security.web.savedrequest.RequestCache
-
removeRequest
public void removeRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)- Specified by:
removeRequestin interfaceorg.springframework.security.web.savedrequest.RequestCache
-
setDelegateRequestCache
public void setDelegateRequestCache(org.springframework.security.web.savedrequest.RequestCache delegateRequestCache)
Sets the cache implementation that is used for the actual saving of the requests that are not ignored.- Parameters:
delegateRequestCache- the delegate request cache
-
-