WebFlux学习(一)
程序员文章站
2022-07-08 10:50:14
...
如何在WebFlux的过滤器中,重定向到第三方页面
@Order(-10000) @Component public class CasWebFilter implements WebFilter { @Override public Mono<Void> filter(ServerWebExchange serverWebExchange, WebFilterChain webFilterChain) { URI location = URI.create("https://www.baidu.com"); ServerRedirectStrategy redirectStrategy = new DefaultServerRedirectStrategy(); return redirectStrategy.sendRedirect(serverWebExchange, location); } }