Alon Bar-Lev has uploaded a new change for review.

Change subject: core: re-support broken apache proxy
......................................................................

core: re-support broken apache proxy

apache proxy support was broken in:
I37156061cbdd, 'core: i18n splash screen.'

The changed cause invalid redirection and the following error message in
console log:
---
Exception while dispatching incoming RPC call:
java.lang.SecurityException: Blocked request without GWT base path
header (XSRF attack?)
---

Content:

1. Remove unused ovirt-engine.html (what was index.html) as it is
   superseded by index.jsp

2. Remove redundant welcome directive from web.xml

3. Rename /index.jsp to /ovirt-engine.jsp to be referenced by both
   apache and jboss.

4. Rename servlet mapping of /index to /ovirt-engine.

5. Modify 404.html pages to redirect to /ovirt-engine instead of
   /ovirt-engine.html

6. Remove reference of ovirt-engine.html from the proxy.

Change-Id: I7ac8feb720d73f0b1107b0bf0908930c525ea542
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M 
backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
M backend/manager/modules/root/src/main/webapp/404.html
R backend/manager/modules/root/src/main/webapp/WEB-INF/ovirt-engine.jsp
M backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml
D backend/manager/modules/root/src/main/webapp/ovirt-engine.html
M 
backend/manager/modules/root/src/test/java/org/ovirt/engine/core/SplashServletTest.java
M frontend/webadmin/modules/userportal-gwtp/src/main/webapp/404.html
M frontend/webadmin/modules/webadmin/src/main/webapp/404.html
M packaging/fedora/setup/ovirt-engine-proxy.conf.in
9 files changed, 14 insertions(+), 74 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/04/14304/1

diff --git 
a/backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
 
b/backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
index 7422150..af2c391 100644
--- 
a/backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
+++ 
b/backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
@@ -19,7 +19,7 @@
 /**
  * This Servlet serves the splash page to allow users to select either web 
admin or user portal.
  */
-@WebServlet(value = "/index")
+@WebServlet(value = "/ovirt-engine")
 public class SplashServlet extends HttpServlet {
     /**
      * Logger.
@@ -48,7 +48,7 @@
         log.info("Detected Locale: " + userLocale.toLanguageTag());
         request.setAttribute(LOCALE_KEYS, getLocaleKeys());
         setCookie(response, userLocale);
-        RequestDispatcher dispatcher = 
request.getRequestDispatcher("/WEB-INF/index.jsp");
+        RequestDispatcher dispatcher = 
request.getRequestDispatcher("/WEB-INF/ovirt-engine.jsp");
         response.setContentType("text/html;charset=UTF-8");
         if (dispatcher != null) {
             dispatcher.include(request, response);
diff --git a/backend/manager/modules/root/src/main/webapp/404.html 
b/backend/manager/modules/root/src/main/webapp/404.html
index 86e5772..1bb4782 100644
--- a/backend/manager/modules/root/src/main/webapp/404.html
+++ b/backend/manager/modules/root/src/main/webapp/404.html
@@ -2,7 +2,7 @@
        "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='/ovirt-engine.html'" />
+<meta http-equiv="refresh" content="0;URL='/ovirt-engine'" />
 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
 <title>oVirt-Engine</title>
 <link rel="stylesheet" href="/ovirt-engine-style.css" type="text/css" 
media="screen, projection" charset="utf-8" />
@@ -16,7 +16,7 @@
        </div>
        <div class="main">
                <h2><span class="fakeH2">Page not found.</span></h2>
-               Press <a href="/ovirt-engine.html">here</a> to continue.
+               Press <a href="/ovirt-engine">here</a> to continue.
        </div>
 </body>
 </html>
diff --git a/backend/manager/modules/root/src/main/webapp/WEB-INF/index.jsp 
b/backend/manager/modules/root/src/main/webapp/WEB-INF/ovirt-engine.jsp
similarity index 86%
rename from backend/manager/modules/root/src/main/webapp/WEB-INF/index.jsp
rename to backend/manager/modules/root/src/main/webapp/WEB-INF/ovirt-engine.jsp
index e364d0b..501fce3 100644
--- a/backend/manager/modules/root/src/main/webapp/WEB-INF/index.jsp
+++ b/backend/manager/modules/root/src/main/webapp/WEB-INF/ovirt-engine.jsp
@@ -44,9 +44,9 @@
                 <c:if test="${requestScope['locale'].toString() == 'en_US'}">
                     <c:set var="localeParam" value=""/>
                 </c:if>
-                <div><a 
href="UserPortal/org.ovirt.engine.ui.userportal.UserPortal/UserPortal.html${localeParam}"><fmt:message
 key="splash.menu.userportal" /></a></div>
-                <div><a 
href="webadmin/webadmin/WebAdmin.html${localeParam}"><fmt:message 
key="splash.menu.adminportal" /></a></div>
-                <div><a 
href="OvirtEngineWeb/RedirectServlet?Page=Reports"><fmt:message 
key="splash.menu.reportsportal" /></a></div>
+                <div><a 
href="/UserPortal/org.ovirt.engine.ui.userportal.UserPortal/UserPortal.html${localeParam}"><fmt:message
 key="splash.menu.userportal" /></a></div>
+                <div><a 
href="/webadmin/webadmin/WebAdmin.html${localeParam}"><fmt:message 
key="splash.menu.adminportal" /></a></div>
+                <div><a 
href="/OvirtEngineWeb/RedirectServlet?Page=Reports"><fmt:message 
key="splash.menu.reportsportal" /></a></div>
             </div>
         </div>
         <div class="locale_select_panel">
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 9fb47c2..b0eceb6 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
@@ -206,14 +206,10 @@
     <url-pattern>/OvirtEngineWeb/ValidateSession</url-pattern>
   </servlet-mapping>
 
-  <welcome-file-list>
-    <welcome-file>ovirt-engine.html</welcome-file>
-  </welcome-file-list>
-
   <!-- Filters -->
   <filter-mapping>
     <filter-name>LocaleFilter</filter-name>
-    <url-pattern>/index</url-pattern>
+    <url-pattern>/ovirt-engine</url-pattern>
   </filter-mapping>
 
   <!-- Go to the index when a page is not found (preserving the
@@ -225,6 +221,6 @@
 
   <!-- This is handled by the splash servlet -->
   <welcome-file-list>
-    <welcome-file>index</welcome-file>
+    <welcome-file>ovirt-engine</welcome-file>
   </welcome-file-list>
 </web-app>
diff --git a/backend/manager/modules/root/src/main/webapp/ovirt-engine.html 
b/backend/manager/modules/root/src/main/webapp/ovirt-engine.html
deleted file mode 100644
index 405caa6..0000000
--- a/backend/manager/modules/root/src/main/webapp/ovirt-engine.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!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="Content-type" content="text/html; charset=utf-8" />
-       <title>oVirt-Engine</title>
-       <link rel="stylesheet" href="ovirt-engine-style.css" type="text/css" 
media="screen, projection" charset="utf-8" />
-       <script src="engineVersion.js" type="text/javascript"></script>
-       <script type="text/javascript">
-       
-       function pageLoaded()
-       {
-               document.getElementById("warningMessage").style.display = 
"none";
-               document.getElementById("dynamicLinksSection").style.display = 
"block";         
-       }
-       </script>
-</head>
-<body onload="pageLoaded()">
-       <div>
-               <div class="left">
-                       
-               </div>
-               
-               <div class="center">
-                
-               </div>
-       </div>
-       <div class="main">
-               <div class="welcome">Welcome to Open Virtualization 
Manager.</div>
-               <div class="welcome">  
-                        <script type="text/JavaScript">
-                       <!--
-                       document.write("Version " + myVersion)
-                       //-->
-                       </script>
-               </div>
-               
-               <div class="warningMessage" id="warningMessage">
-                       <b>* Your current browser settings prevent displaying 
this page correctly!</b>
-                       Please allow Javascript to run on your browser (for 
example, by adding this site to 'Trusted Sites') and then refresh the page.
-               </div>
-
-               <div id='dynamicLinksSection' style="display: none;">
-                       <div>
-                       <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>
-               </div>
-       </div>
-</body>
-</html>
diff --git 
a/backend/manager/modules/root/src/test/java/org/ovirt/engine/core/SplashServletTest.java
 
b/backend/manager/modules/root/src/test/java/org/ovirt/engine/core/SplashServletTest.java
index 8ff548c..1591515 100644
--- 
a/backend/manager/modules/root/src/test/java/org/ovirt/engine/core/SplashServletTest.java
+++ 
b/backend/manager/modules/root/src/test/java/org/ovirt/engine/core/SplashServletTest.java
@@ -67,7 +67,7 @@
         responseCookie.setSecure(false); //Doesn't have to be secure.
         responseCookie.setMaxAge(Integer.MAX_VALUE); //Doesn't expire.
         
when(mockRequest.getAttribute(LocaleFilter.LOCALE)).thenReturn(Locale.JAPANESE);
-        
when(mockRequest.getRequestDispatcher("/WEB-INF/index.jsp")).thenReturn(mockDispatcher);
+        
when(mockRequest.getRequestDispatcher("/WEB-INF/ovirt-engine.jsp")).thenReturn(mockDispatcher);
         testServlet.doGet(mockRequest, mockResponse);
         verify(mockRequest).setAttribute("localeKeys", localeKeys);
         verify(mockResponse).addCookie(cookieCaptor.capture());
diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/404.html 
b/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/404.html
index 86e5772..1bb4782 100644
--- a/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/404.html
+++ b/frontend/webadmin/modules/userportal-gwtp/src/main/webapp/404.html
@@ -2,7 +2,7 @@
        "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='/ovirt-engine.html'" />
+<meta http-equiv="refresh" content="0;URL='/ovirt-engine'" />
 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
 <title>oVirt-Engine</title>
 <link rel="stylesheet" href="/ovirt-engine-style.css" type="text/css" 
media="screen, projection" charset="utf-8" />
@@ -16,7 +16,7 @@
        </div>
        <div class="main">
                <h2><span class="fakeH2">Page not found.</span></h2>
-               Press <a href="/ovirt-engine.html">here</a> to continue.
+               Press <a href="/ovirt-engine">here</a> to continue.
        </div>
 </body>
 </html>
diff --git a/frontend/webadmin/modules/webadmin/src/main/webapp/404.html 
b/frontend/webadmin/modules/webadmin/src/main/webapp/404.html
index 86e5772..1bb4782 100644
--- a/frontend/webadmin/modules/webadmin/src/main/webapp/404.html
+++ b/frontend/webadmin/modules/webadmin/src/main/webapp/404.html
@@ -2,7 +2,7 @@
        "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='/ovirt-engine.html'" />
+<meta http-equiv="refresh" content="0;URL='/ovirt-engine'" />
 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
 <title>oVirt-Engine</title>
 <link rel="stylesheet" href="/ovirt-engine-style.css" type="text/css" 
media="screen, projection" charset="utf-8" />
@@ -16,7 +16,7 @@
        </div>
        <div class="main">
                <h2><span class="fakeH2">Page not found.</span></h2>
-               Press <a href="/ovirt-engine.html">here</a> to continue.
+               Press <a href="/ovirt-engine">here</a> to continue.
        </div>
 </body>
 </html>
diff --git a/packaging/fedora/setup/ovirt-engine-proxy.conf.in 
b/packaging/fedora/setup/ovirt-engine-proxy.conf.in
index e8b7258..727ed84 100644
--- a/packaging/fedora/setup/ovirt-engine-proxy.conf.in
+++ b/packaging/fedora/setup/ovirt-engine-proxy.conf.in
@@ -20,7 +20,6 @@
     </Proxy>
 
     Redirect /ovirt-engine /ovirt-engine/
-    Redirect /ovirt-engine.html /ovirt-engine/
 
     <Location /ovirt-engine/>
         ProxyPass ajp://localhost:@JBOSS_AJP_PORT@/


--
To view, visit http://gerrit.ovirt.org/14304
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ac8feb720d73f0b1107b0bf0908930c525ea542
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

Reply via email to