<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Webfilterchain on Micha Kops&#39; Tech Notes</title>
    <link>https://www.hascode.com/tags/webfilterchain/</link>
    <description>Recent content in Webfilterchain on Micha Kops&#39; Tech Notes</description>
    <generator>Hugo -- 0.147.8</generator>
    <language>en</language>
    <copyright>Copyright © 2010 - 2025 Micha Kops. #213243b1d6e8932079e09227d3f3ed0c806cd0c9</copyright>
    <lastBuildDate>Tue, 16 Aug 2022 00:00:00 +0200</lastBuildDate>
    <atom:link href="https://www.hascode.com/tags/webfilterchain/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Forwardings Requests to static content in Spring Boot Webflux</title>
      <link>https://www.hascode.com/forwardings-requests-to-static-content-in-spring-boot-webflux/</link>
      <pubDate>Tue, 16 Aug 2022 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/forwardings-requests-to-static-content-in-spring-boot-webflux/</guid>
      <description>&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;The following &lt;code&gt;WebFilter&lt;/code&gt; redirects incoming requests for &lt;code&gt;/&lt;/code&gt; to a static HTML file, &lt;code&gt;index.html&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;ToIndexPageRedirection.java&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;package com.hascode.tutorial;

import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebFilterChain;
import reactor.core.publisher.Mono;

@Component
public class ToIndexPageRedirection implements WebFilter {
    @Override
    public Mono&amp;lt;Void&amp;gt; filter(ServerWebExchange exchange, WebFilterChain chain) {
        if (exchange.getRequest().getURI().getPath().equals(&amp;#34;/&amp;#34;)) {
            return chain.filter(
                exchange.mutate().request(
                    exchange.getRequest().mutate().path(&amp;#34;/index.html&amp;#34;).build()
                ).build()
            );
        }

        return chain.filter(exchange);
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;&lt;strong&gt;Ressources:&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;ulist&#34;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/server/WebFilter.html&#34;&gt;JavaDocs WebFilter&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
