System.out.println("SecurityFilter.doFilter");
Principal principal = ((HttpServletRequest) req).getUserPrincipal();
if (principal == null) {
req.setAttribute("errorMessage", "You are not logged in!");
req.getRequestDispatcher("/login.jsp").forward(req, res);
} else {
chain.doFilter(req, res);
}