Alon Bar-Lev has uploaded a new change for review. Change subject: core: Redirect to index when page not found ......................................................................
core: Redirect to index when page not found This is a fix for commit 2107a03979 (ouput index.html as error page), which was a fix for commit 66edaab361 (redirect servlet). Introduce error.html at root, webapp, userportal-gwtp. Use HTTP meta refresh to redirect to root context. As a result the index.html hrefs can be relative as they should. Repeating the note: HTTP Redirect causing problems with clients (GWT for example) that follow the redirect and this don't recieve the error code. Change-Id: I63e7992a748935347eee7b65930bc6d29fdb92db Signed-off-by: Alon Bar-Lev <alo...@redhat.com> --- M backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml A backend/manager/modules/root/src/main/webapp/error.html M backend/manager/modules/root/src/main/webapp/index.html M frontend/webadmin/modules/userportal-gwtp/src/main/webapp/WEB-INF/web.xml A frontend/webadmin/modules/userportal-gwtp/src/main/webapp/error.html M frontend/webadmin/modules/webadmin/src/main/webapp/WEB-INF/web.xml A frontend/webadmin/modules/webadmin/src/main/webapp/error.html 7 files changed, 82 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/53/7153/1 diff --git a/backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml b/backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml index 1658ccc..6af6973 100644 --- a/backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml +++ b/backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml @@ -205,7 +205,7 @@ 404 status code): --> <error-page> <error-code>404</error-code> - <location>/index.html</location> + <location>/error.html</location> </error-page> </web-app> diff --git a/backend/manager/modules/root/src/main/webapp/error.html b/backend/manager/modules/root/src/main/webapp/error.html new file mode 100644 index 0000000..cb847dd --- /dev/null +++ b/backend/manager/modules/root/src/main/webapp/error.html @@ -0,0 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="refresh" content="0;URL='/'" /> +<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> +<title>Ovirt-Engine</title> +<link rel="stylesheet" href="/style.css" type="text/css" media="screen, projection" charset="utf-8" /> +</head> + <div> + <div class="left"> + </div> + <div class="center"> + </div> + </div> + <div class="main"> + <h2><span class="fakeH2">Page not found.</span></h2> + Press <a href="/">here</a> to continue. + </div> +<body> +</body> +</html> diff --git a/backend/manager/modules/root/src/main/webapp/index.html b/backend/manager/modules/root/src/main/webapp/index.html index abcf6a7..3777e33 100644 --- a/backend/manager/modules/root/src/main/webapp/index.html +++ b/backend/manager/modules/root/src/main/webapp/index.html @@ -45,9 +45,9 @@ <h2> <span class="fakeH2">Portals</span> </h2> - <div><a href="/UserPortal">User Portal</a></div> - <div><a href="/webadmin">Administrator Portal</a></div> - <div><a href="/OvirtEngineWeb/RedirectServlet?Page=Reports">Reports Portal</a></div> + <div><a href="UserPortal">User Portal</a></div> + <div><a href="webadmin">Administrator Portal</a></div> + <div><a href="OvirtEngineWeb/RedirectServlet?Page=Reports">Reports Portal</a></div> </div> </div> </body> diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/WEB-INF/web.xml b/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/WEB-INF/web.xml index 78232b5..d6fca6a 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/WEB-INF/web.xml +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/WEB-INF/web.xml @@ -28,6 +28,12 @@ <welcome-file>index.html</welcome-file> </welcome-file-list> + <!-- Error page to present --> + <error-page> + <error-code>404</error-code> + <location>/error.html</location> + </error-page> + <!-- confidentiality --> <security-constraint> <web-resource-collection> diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/error.html b/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/error.html new file mode 100644 index 0000000..cb847dd --- /dev/null +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/error.html @@ -0,0 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="refresh" content="0;URL='/'" /> +<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> +<title>Ovirt-Engine</title> +<link rel="stylesheet" href="/style.css" type="text/css" media="screen, projection" charset="utf-8" /> +</head> + <div> + <div class="left"> + </div> + <div class="center"> + </div> + </div> + <div class="main"> + <h2><span class="fakeH2">Page not found.</span></h2> + Press <a href="/">here</a> to continue. + </div> +<body> +</body> +</html> diff --git a/frontend/webadmin/modules/webadmin/src/main/webapp/WEB-INF/web.xml b/frontend/webadmin/modules/webadmin/src/main/webapp/WEB-INF/web.xml index f80fdd7..426c851 100644 --- a/frontend/webadmin/modules/webadmin/src/main/webapp/WEB-INF/web.xml +++ b/frontend/webadmin/modules/webadmin/src/main/webapp/WEB-INF/web.xml @@ -28,6 +28,12 @@ <welcome-file>index.html</welcome-file> </welcome-file-list> + <!-- Error page to present --> + <error-page> + <error-code>404</error-code> + <location>/error.html</location> + </error-page> + <!-- confidentiality --> <security-constraint> <web-resource-collection> diff --git a/frontend/webadmin/modules/webadmin/src/main/webapp/error.html b/frontend/webadmin/modules/webadmin/src/main/webapp/error.html new file mode 100644 index 0000000..cb847dd --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/webapp/error.html @@ -0,0 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="refresh" content="0;URL='/'" /> +<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> +<title>Ovirt-Engine</title> +<link rel="stylesheet" href="/style.css" type="text/css" media="screen, projection" charset="utf-8" /> +</head> + <div> + <div class="left"> + </div> + <div class="center"> + </div> + </div> + <div class="main"> + <h2><span class="fakeH2">Page not found.</span></h2> + Press <a href="/">here</a> to continue. + </div> +<body> +</body> +</html> -- To view, visit http://gerrit.ovirt.org/7153 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63e7992a748935347eee7b65930bc6d29fdb92db Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches