List of usage examples for org.springframework.security.web.context SaveContextOnUpdateOrErrorResponseWrapper isContextSaved
public final boolean isContextSaved()
saveContext() because of this wrapper. From source file:org.springframework.security.web.context.HttpSessionSecurityContextRepository.java
public void saveContext(SecurityContext context, HttpServletRequest request, HttpServletResponse response) { SaveContextOnUpdateOrErrorResponseWrapper responseWrapper = WebUtils.getNativeResponse(response, SaveContextOnUpdateOrErrorResponseWrapper.class); if (responseWrapper == null) { throw new IllegalStateException("Cannot invoke saveContext on response " + response + ". You must use the HttpRequestResponseHolder.response after invoking loadContext"); }//from w ww . j ava2 s. c o m // saveContext() might already be called by the response wrapper // if something in the chain called sendError() or sendRedirect(). This ensures we // only call it // once per request. if (!responseWrapper.isContextSaved()) { responseWrapper.saveContext(context); } }