@Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        String method = request.getMethod();

        // TODO: maybe handle them correctly in the future
        if ("OPTIONS".equalsIgnoreCase(method) || "TRACE".equalsIgnoreCase(method)) {
            super.service(request, response);
            return;
        }

        Object page = request.getAttribute(AttributeNames.PAGE);

        if (page instanceof Page) {
            ((Page) page).service(getServletContext(), request, response);
        } else {
            response.sendError(404);
        }
    }