| 
									
										
										
										
											2022-10-26 09:49:09 -05:00
										 |  |  | .`RequestCache` Only Checks for Saved Requests if `continue` Parameter Present | 
					
						
							| 
									
										
										
										
											2023-06-18 21:32:35 -05:00
										 |  |  | [tabs] | 
					
						
							|  |  |  | ====== | 
					
						
							|  |  |  | Java:: | 
					
						
							|  |  |  | + | 
					
						
							| 
									
										
										
										
											2022-10-26 09:49:09 -05:00
										 |  |  | [source,java,role="primary"] | 
					
						
							|  |  |  | ---- | 
					
						
							|  |  |  | @Bean | 
					
						
							|  |  |  | DefaultSecurityFilterChain springSecurity(HttpSecurity http) throws Exception { | 
					
						
							|  |  |  | 	HttpSessionRequestCache requestCache = new HttpSessionRequestCache(); | 
					
						
							|  |  |  | 	requestCache.setMatchingRequestParameterName("continue"); | 
					
						
							|  |  |  | 	http | 
					
						
							|  |  |  | 		// ... | 
					
						
							|  |  |  | 		.requestCache((cache) -> cache | 
					
						
							|  |  |  | 			.requestCache(requestCache) | 
					
						
							|  |  |  | 		); | 
					
						
							|  |  |  | 	return http.build(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | ---- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-18 21:32:35 -05:00
										 |  |  | Kotlin:: | 
					
						
							|  |  |  | + | 
					
						
							| 
									
										
										
										
											2022-10-26 09:49:09 -05:00
										 |  |  | [source,kotlin,role="secondary"] | 
					
						
							|  |  |  | ---- | 
					
						
							| 
									
										
										
										
											2022-10-27 15:13:50 -05:00
										 |  |  | @Bean | 
					
						
							|  |  |  | open fun springSecurity(http: HttpSecurity): SecurityFilterChain { | 
					
						
							|  |  |  |     val httpRequestCache = HttpSessionRequestCache() | 
					
						
							|  |  |  |     httpRequestCache.setMatchingRequestParameterName("continue") | 
					
						
							|  |  |  |     http { | 
					
						
							|  |  |  |         requestCache { | 
					
						
							|  |  |  |             requestCache = httpRequestCache | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return http.build() | 
					
						
							| 
									
										
										
										
											2022-10-26 09:49:09 -05:00
										 |  |  | } | 
					
						
							|  |  |  | ---- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-18 21:32:35 -05:00
										 |  |  | XML:: | 
					
						
							|  |  |  | + | 
					
						
							| 
									
										
										
										
											2022-10-26 09:49:09 -05:00
										 |  |  | [source,xml,role="secondary"] | 
					
						
							|  |  |  | ---- | 
					
						
							|  |  |  | <http auto-config="true"> | 
					
						
							|  |  |  | 	<!-- ... --> | 
					
						
							|  |  |  | 	<request-cache ref="requestCache"/> | 
					
						
							|  |  |  | </http> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <b:bean id="requestCache" class="org.springframework.security.web.savedrequest.HttpSessionRequestCache" | 
					
						
							|  |  |  | 	p:matchingRequestParameterName="continue"/> | 
					
						
							|  |  |  | ---- | 
					
						
							| 
									
										
										
										
											2023-06-18 21:32:35 -05:00
										 |  |  | ====== |