public void insertAttributes(HttpServletRequest request) {
        this.requestAttributes.entrySet().stream().forEach((e) -> {
            request.setAttribute(e.getKey(), e.getValue());
        });
        if (!this.sessionAttributes.isEmpty()) {
            HttpSession session = request.getSession();
            this.sessionAttributes.entrySet().stream().forEach((e) -> {
                session.setAttribute(e.getKey(), e.getValue());
            });
            this.deletedSessionAttributes.stream().forEach((attrName) -> {
                session.removeAttribute(attrName);
            });
        } else {
            request.getSession().invalidate();
            ((HttpServletRequest)request).getSession(true).setAttribute("locale", locale);
        }
    }