request-cache-continue.adoc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .`RequestCache` Only Checks for Saved Requests if `continue` Parameter Present
  2. [tabs]
  3. ======
  4. Java::
  5. +
  6. [source,java,role="primary"]
  7. ----
  8. @Bean
  9. DefaultSecurityFilterChain springSecurity(HttpSecurity http) throws Exception {
  10. HttpSessionRequestCache requestCache = new HttpSessionRequestCache();
  11. requestCache.setMatchingRequestParameterName("continue");
  12. http
  13. // ...
  14. .requestCache((cache) -> cache
  15. .requestCache(requestCache)
  16. );
  17. return http.build();
  18. }
  19. ----
  20. Kotlin::
  21. +
  22. [source,kotlin,role="secondary"]
  23. ----
  24. @Bean
  25. open fun springSecurity(http: HttpSecurity): SecurityFilterChain {
  26. val httpRequestCache = HttpSessionRequestCache()
  27. httpRequestCache.setMatchingRequestParameterName("continue")
  28. http {
  29. requestCache {
  30. requestCache = httpRequestCache
  31. }
  32. }
  33. return http.build()
  34. }
  35. ----
  36. XML::
  37. +
  38. [source,xml,role="secondary"]
  39. ----
  40. <http auto-config="true">
  41. <!-- ... -->
  42. <request-cache ref="requestCache"/>
  43. </http>
  44. <b:bean id="requestCache" class="org.springframework.security.web.savedrequest.HttpSessionRequestCache"
  45. p:matchingRequestParameterName="continue"/>
  46. ----
  47. ======