[pal-cvs 3208] [945] replaced with meta redirect.

svnno****@sourc***** svnno****@sourc*****
2008年 6月 2日 (月) 07:07:04 JST


Revision: 945
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=945
Author:   shinsuke
Date:     2008-06-02 07:07:04 +0900 (Mon, 02 Jun 2008)

Log Message:
-----------
replaced with meta redirect.

Modified Paths:
--------------
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java


-------------- next part --------------
Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java	2008-05-31 23:19:25 UTC (rev 944)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/redirect/impl/SSLRedirectValveImpl.java	2008-06-01 22:07:04 UTC (rev 945)
@@ -1,6 +1,7 @@
 package jp.sf.pal.portal.redirect.impl;
 
 import java.io.IOException;
+import java.io.PrintWriter;
 
 import javax.servlet.http.HttpServletRequest;
 
@@ -16,6 +17,10 @@
 public class SSLRedirectValveImpl extends AbstractValve
 {
 
+    private static final String REDIRECT_CONTENT_SUFFIX = "\"/></head><body></body></html>";
+
+    private static final String REDIRECT_CONTENT_PREFIX = "<html><head><meta http-equiv=\"refresh\" content=\"0;url=";
+
     private static final String QUERY_SEPARATOR = "?";
 
     private static final String REDIRECT_TO_SSL_PAGE_KEY = "redirect.to.ssl.page";
@@ -143,7 +148,11 @@
             url.append(QUERY_SEPARATOR);
             url.append(servletRequest.getQueryString());
         }
-        request.getResponse().sendRedirect(url.toString());
+
+        PrintWriter out = request.getResponse().getWriter();
+        out.print(REDIRECT_CONTENT_PREFIX);
+        out.print(url.toString());
+        out.print(REDIRECT_CONTENT_SUFFIX);
     }
 
     public String toString()


pal-cvs メーリングリストの案内