// show 404 notfound error. func NotFound(rw http.ResponseWriter, r *http.Request) {t, _ := template.New("beegoerrortemp").Parse(errtpl) data := make(map[string]interface{}) data["Title"] = "Page Not Found" data["Content"] = template.HTML("<br>The page you have requested has flown the coop."+"<br>Perhaps you are here because:"+"<br><br><ul>" + "<br>The page has moved"+"<br>The page no longer exists"+"<br>You were looking for your puppy and got lost"+"<br>You like 404 pages"+"</ul>") data["BeegoVersion"] = VERSION //rw.WriteHeader(http.StatusNotFound) t.Execute(rw, data) }
其实自己做一个修改也很容易:
1 2 3 4 5 6 7 8 9
func page_not_found(rw http.ResponseWriter, r *http.Request){t,_:= template.New("404.html").ParseFiles(beego.ViewsPath+"/404.html") data :=make(map[string]interface{}) data["content"] = "page not found" t.Execute(rw, data) }
// show 404 notfound error. func NotFound(rw http.ResponseWriter, r *http.Request) {t, _ := template.New("beegoerrortemp").Parse(errtpl) data := make(map[string]interface{}) data["Title"] = "Page Not Found" data["Content"] = template.HTML("<br>The page you have requested has flown the coop."+"<br>Perhaps you are here because:"+"<br><br><ul>" + "<br>The page has moved"+"<br>The page no longer exists"+"<br>You were looking for your puppy and got lost"+"<br>You like 404 pages"+"</ul>") data["BeegoVersion"] = VERSION //rw.WriteHeader(http.StatusNotFound) t.Execute(rw, data) }
其实自己做一个修改也很容易:
1 2 3 4 5 6 7 8 9
func page_not_found(rw http.ResponseWriter, r *http.Request){t,_:= template.New("404.html").ParseFiles(beego.ViewsPath+"/404.html") data :=make(map[string]interface{}) data["content"] = "page not found" t.Execute(rw, data) }