package haushaltsbuch.controllers;

import java.io.IOException;
import java.util.Locale;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;

@WebFilter("/*")
public class ContentTypeFilter implements Filter
{
  public void destroy()
  {
    // this space intentionally left blank
  }

  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
  {
    response.setContentType("text/html; charset=utf-8");
    response.setLocale(Locale.GERMANY);

    chain.doFilter(request, response);
  }

  public void init(FilterConfig fConfig) throws ServletException
  {
    // this space intentionally left blank
  }
}

package haushaltsbuch.controllers;

import java.io.IOException;
import java.util.Locale;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;

@WebFilter("/*")
public class ContentTypeFilter implements Filter
{
  public void destroy()
  {
    // this space intentionally left blank
  }

  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
  {
    request.setCharacterEncoding("UTF-8");

    response.setContentType("text/html; charset=utf-8");
    response.setLocale(Locale.GERMANY);

    chain.doFilter(request, response);
  }

  public void init(FilterConfig fConfig) throws ServletException
  {
    // this space intentionally left blank
  }
}

Fix weird character issues by hard-coding to UTF-8
Fix weird character issues by hard-coding to UTF-8
