That's my filter:

```
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
        throws java.io.IOException, javax.servlet.ServletException
{
    HttpServletRequest request = (HttpServletRequest) servletRequest;
    HttpServletResponse response = (HttpServletResponse) servletResponse;
    String currentURL = request.getRequestURI();
    MaintenanceService maintenanceMode = new MaintenanceService();

    if (maintenanceMode.getMaintenanceMode())
    {
        String urlNew = currentURL.concat("maintenance.jsp");
        response.sendRedirect(urlNew);

    }
    filterChain.doFilter(servletRequest, servletResponse);
}

```

"under" maintenanceMode.getMaintenanceMode(), I have variable getter: 

```
boolean maintenanceMode = Boolean.getBoolean("maintenance");

```

With *forward* (server-side redirect) it works fine, when I'm trying client-side redirect:

```
response.sendRedirect(urlNew);

```

I got an infinite occurrences maintenance.jsp concatenating:

```
http://localhost:8080/maintenance.jspmaintenance.jspmaintenance.jspmaintenance.jspmaintenance.jsp

```

why it's not redirecting onto one occurrence, like with server-side redirect:

```
http://localhost:8080/maintenance.jsp

```

Web.xml filter mapping:

```
<filter-mapping>
    <filter-name>maintenanceFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

```