@Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String action = request.getParameter("act");
        if(action != null) {
            try {
                RequestContext context = new RequestContext(request);
                if(context.isLogged()) {
                    int notId = Utilities.chooseParam(request, "id", 0);
                    int id = context.getId();
                    
                    switch(action) {
                        case "read":
                            readNotification(notId, response, context);
                            break;
                        case "readall":
                            NotificationManager.readAll(id);
                            response.sendRedirect("home.jsp");
                            break;
                        default:
                            response.sendRedirect("home.jsp");
                    }
                } else {
                    response.sendRedirect("login.jsp");
                }
            } catch(SQLException e) {
                log.error("SQLException caught in Notification servlet.", e);
                response.sendRedirect("error.jsp?err=dberr");
            }
        } else {
            response.sendRedirect("home.jsp");
        }
    }