def make_not_found_page(self, path): """ Prepares a "page not found" page for a 404 error :param path: Request path :return: A HTML page """ page = None if self._error_handler is not None: page = self._error_handler.make_not_found_page(path) if not page: page = """<html> <head> <title>404 - Page not found</title> </head> <body> <h1>Page not found</h1> <p>No servlet is associated to this path:</p> <pre>{0}</pre> <h2>Registered paths:</h2> {1} </body> </html>""".format( path, http.make_html_list(self.get_registered_paths()) ) return page
def make_not_found_page(self, path): """ Prepares a "page not found" page for a 404 error :param path: Request path :return: A HTML page """ page = None if self._error_handler is not None: page = self._error_handler.make_not_found_page(path) if not page: page = """<html> <head> <title>404 - Page not found</title> </head> <body> <h1>Page not found</h1> <p>No servlet is associated to this path:</p> <pre>{0}</pre> <h2>Registered paths:</h2> {1} </body> </html>""".format(path, http.make_html_list(self.get_registered_paths())) return page