[EMAIL PROTECTED] wrote:
Author: ammulder
Date: Sat Sep  3 10:42:36 2005
New Revision: 267490

URL: http://svn.apache.org/viewcvs?rev=267490&view=rev
Log:
Add redirect to console


<snip/>

+<html>
+  <head>
+    <META HTTP-EQUIV="Refresh" CONTENT="0; URL=../console">
+    <title>Redirect to Portal</title>
+  </head>
+  <body bgcolor="white">
+    <p>This web application contains raw portlets.  It is not useful
+      to a user.  Please see /console instead.</p>
+  </body>
+</html>

By coincidence, I was chatting with someone last week about web stuff and they pointed me at this:
http://www.seocompany.ca/seo/url-redirect.html

How about just sending a 301 reponse with the actual location of the console? Patch attached as illustration.

--
Jeremy

Index: applications/console-standard/src/java/org/apache/geronimo/console/RedirectServlet.java
===================================================================
--- applications/console-standard/src/java/org/apache/geronimo/console/RedirectServlet.java (revision 0) +++ applications/console-standard/src/java/org/apache/geronimo/console/RedirectServlet.java (revision 0)
@@ -0,0 +1,33 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console;
+
+import java.io.IOException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class RedirectServlet extends HttpServlet {
+ protected void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { + httpServletResponse.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
+        httpServletResponse.setHeader("Location", "/console/");
+    }
+}
Index: applications/console-standard/src/webapp/WEB-INF/web.xml
===================================================================
--- applications/console-standard/src/webapp/WEB-INF/web.xml (revision 267492)
+++ applications/console-standard/src/webapp/WEB-INF/web.xml    (working copy)
@@ -647,8 +647,18 @@
         </init-param>
     </servlet>

+    <servlet>
+        <description>Redirector to the main console</description>
+        <servlet-name>Redirect</servlet-name>
+ <servlet-class>org.apache.geronimo.console.RedirectServlet</servlet-class>
+    </servlet>

+    <servlet-mapping>
+        <servlet-name>Redirect</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>

+
     <servlet-mapping>
         <servlet-name>EJBServer</servlet-name>
         <url-pattern>/EJBServer/*</url-pattern>
@@ -845,10 +855,7 @@
         <role-name>tomcat</role-name>
     </security-role>
     -->
-    <welcome-file-list>
-        <welcome-file>index.html</welcome-file>
-    </welcome-file-list>
-
+
     <jsp-config>
         <taglib>
             <taglib-uri>http://java.sun.com/portlet</taglib-uri>
Index: applications/console-standard/src/webapp/index.html
===================================================================
--- applications/console-standard/src/webapp/index.html (revision 267492)
+++ applications/console-standard/src/webapp/index.html (working copy)
@@ -1,10 +0,0 @@
-<html>
-  <head>
-    <META HTTP-EQUIV="Refresh" CONTENT="0; URL=../console">
-    <title>Redirect to Portal</title>
-  </head>
-  <body bgcolor="white">
-    <p>This web application contains raw portlets.  It is not useful
-      to a user.  Please see /console instead.</p>
-  </body>
-</html>

Reply via email to