geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r807900 - /geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/FormAuthenticator.java
Date Wed, 26 Aug 2009 07:25:07 GMT
Author: xuhaihong
Date: Wed Aug 26 07:25:06 2009
New Revision: 807900

URL: http://svn.apache.org/viewvc?rev=807900&view=rev
Log:
GERONIMO-4814 Disable the cache while forwarding to the login/error page in the form authentication


Modified:
    geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/FormAuthenticator.java

Modified: geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/FormAuthenticator.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/FormAuthenticator.java?rev=807900&r1=807899&r2=807900&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/FormAuthenticator.java
(original)
+++ geronimo/server/branches/2.2/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/security/authentication/FormAuthenticator.java
Wed Aug 26 07:25:06 2009
@@ -217,6 +217,7 @@
     protected void forwardToLoginPage(Request request, Response response) {
         RequestDispatcher disp = request.getRequestDispatcher(loginPage);
         try {
+            disableClientCache(response.getResponse());
             disp.forward(request.getRequest(), response.getResponse());
             response.finishResponse();
         } catch (Throwable t) {
@@ -234,6 +235,7 @@
     protected void forwardToErrorPage(Request request, Response response) {
         RequestDispatcher disp = request.getRequestDispatcher(erroryPage);
         try {
+            disableClientCache(response.getResponse());
             disp.forward(request.getRequest(), response.getResponse());
             response.finishResponse();
         } catch (Throwable t) {
@@ -351,6 +353,7 @@
 
         request.getCoyoteRequest().requestURI().setString
                 (saved.getRequestURI());
+        disableClientCache(request.getResponse().getResponse());
         return (true);
 
     }
@@ -434,4 +437,8 @@
 
     }
 
+    private void disableClientCache(HttpServletResponse response) {
+        response.setHeader("Cache-Control", "No-cache");
+        response.setDateHeader("Expires", 1);
+    }
 }



Mime
View raw message