{"action":"created","issue":{"url":"https://api.github.com/repos/loklak/loklak_server/issues/286","repository_url":"https://api.github.com/repos/loklak/loklak_server","labels_url":"https://api.github.com/repos/loklak/loklak_server/issues/286/labels{/name}","comments_url":"https://api.github.com/repos/loklak/loklak_server/issues/286/comments","events_url":"https://api.github.com/repos/loklak/loklak_server/issues/286/events","html_url":"https://github.com/loklak/loklak_server/issues/286","id":147645068,"number":286,"title":"Don't let 404s be the end of the road for the user.","user":{"login":"sudheesh001","id":4545925,"avatar_url":"https://avatars.githubusercontent.com/u/4545925?v=3","gravatar_id":"","url":"https://api.github.com/users/sudheesh001","html_url":"https://github.com/sudheesh001","followers_url":"https://api.github.com/users/sudheesh001/followers","following_url":"https://api.github.com/users/sudheesh001/following{/other_user}","gists_url":"https://api.github.com/users/sudheesh001/gists{/gist_id}","starred_url":"https://api.github.com/users/sudheesh001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudheesh001/subscriptions","organizations_url":"https://api.github.com/users/sudheesh001/orgs","repos_url":"https://api.github.com/users/sudheesh001/repos","events_url":"https://api.github.com/users/sudheesh001/events{/privacy}","received_events_url":"https://api.github.com/users/sudheesh001/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/loklak/loklak_server/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/loklak/loklak_server/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-12T06:22:32Z","updated_at":"2016-04-18T05:37:10Z","closed_at":null,"body":"404 pages are what users really hate, it'd be nice to ensure that these pages do not frustrate users with log failure messages but instead take the opportunity to put users in the right direction again. loklak server lacks a custom 404 page. I gave it a shot here. Image credits open clip art: https://openclipart.org/detail/171518/grasseating-cow\r\n\r\n<img width=\"1440\" alt=\"screen shot 2016-04-12 at 11 45 28 am\" src=\"https://cloud.githubusercontent.com/assets/4545925/14451347/122152b6-00a4-11e6-9753-85d064950ab0.png\">\r\n\r\nThis is the initial attempt, I am open to more ideas about the text that could be used and the image. @mariobehling what do you think ?\r\n\r\n@Orbiter I've read the jetty [custom error pages](https://wiki.eclipse.org/Jetty/Howto/Custom_Error_Pages) documentation but wasn't able to write the error codes with the `web.xml` file so that the server could automatically redirect to the 404 page if it hits the error.\r\n\r\nIs the error handling happening here for the 404 pages too ?\r\n```java\r\nErrorHandler errorHandler = new ErrorHandler();\r\nerrorHandler.setShowStacks(true);\r\nservletHandler.setErrorHandler(errorHandler);\r\n```\r\n\r\nCan this be extended as documented here ?\r\n> ## Custom error handler class\r\nA context may be configured with a custom error handler class that extends either ErrorHandler for generic contexts, or ErrorPageErrorHandler for webapp contexts.\r\nThe following methods may be implemented to control the appearance of the error pages:\r\n```java\r\nvoid handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException\r\nvoid handleErrorPage(HttpServletRequest request, Writer writer, int code, String message) throws IOException\r\nvoid writeErrorPage(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks) throws IOException\r\nvoid writeErrorPageHead(HttpServletRequest request, Writer writer, int code, String message) throws IOException\r\nvoid writeErrorPageBody(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks) throws IOException\r\nvoid writeErrorPageMessage(HttpServletRequest request, Writer writer, int code, String message, String uri) throws IOException\r\nvoid writeErrorPageStacks(HttpServletRequest request, Writer writer) throws IOException\r\n```"},"comment":{"url":"https://api.github.com/repos/loklak/loklak_server/issues/comments/211211518","html_url":"https://github.com/loklak/loklak_server/issues/286#issuecomment-211211518","issue_url":"https://api.github.com/repos/loklak/loklak_server/issues/286","id":211211518,"user":{"login":"sudheesh001","id":4545925,"avatar_url":"https://avatars.githubusercontent.com/u/4545925?v=3","gravatar_id":"","url":"https://api.github.com/users/sudheesh001","html_url":"https://github.com/sudheesh001","followers_url":"https://api.github.com/users/sudheesh001/followers","following_url":"https://api.github.com/users/sudheesh001/following{/other_user}","gists_url":"https://api.github.com/users/sudheesh001/gists{/gist_id}","starred_url":"https://api.github.com/users/sudheesh001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudheesh001/subscriptions","organizations_url":"https://api.github.com/users/sudheesh001/orgs","repos_url":"https://api.github.com/users/sudheesh001/repos","events_url":"https://api.github.com/users/sudheesh001/events{/privacy}","received_events_url":"https://api.github.com/users/sudheesh001/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T05:37:10Z","updated_at":"2016-04-18T05:37:10Z","body":"@daminisatya @sopu Thanks for the feedback, dropping the search option."}}