myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1087885 - in /myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet: ServletExternalContextImpl.java StartupServletExternalContextImpl.java
Date Fri, 01 Apr 2011 20:26:48 GMT
Author: lu4242
Date: Fri Apr  1 20:26:47 2011
New Revision: 1087885

URL: http://svn.apache.org/viewvc?rev=1087885&view=rev
Log:
MYFACES-3088 Implement ExternalContext.isSecure() and getSessionMaxInactiveInterval() method

Modified:
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/StartupServletExternalContextImpl.java

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java?rev=1087885&r1=1087884&r2=1087885&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
Fri Apr  1 20:26:47 2011
@@ -18,8 +18,19 @@
  */
 package org.apache.myfaces.context.servlet;
 
-import org.apache.myfaces.shared_impl.context.flash.FlashImpl;
-import org.apache.myfaces.util.EnumerationIterator;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.net.URLEncoder;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.logging.Logger;
 
 import javax.faces.FacesException;
 import javax.faces.context.FacesContext;
@@ -35,19 +46,9 @@ import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.net.URLEncoder;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.logging.Logger;
+
+import org.apache.myfaces.shared_impl.context.flash.FlashImpl;
+import org.apache.myfaces.util.EnumerationIterator;
 
 /**
  * Implements the external context for servlet request. JSF 1.2, 6.1.3
@@ -853,12 +854,14 @@ public final class ServletExternalContex
     @Override
     public int getSessionMaxInactiveInterval()
     {
-        throw new UnsupportedOperationException();
+        HttpSession session = _httpServletRequest.getSession();
+        return session.getMaxInactiveInterval();
     }
     
     @Override
     public void setSessionMaxInactiveInterval(int interval)
     {
-        throw new UnsupportedOperationException();
+        HttpSession session = _httpServletRequest.getSession();
+        session.setMaxInactiveInterval(interval);
     }
 }

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/StartupServletExternalContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/StartupServletExternalContextImpl.java?rev=1087885&r1=1087884&r2=1087885&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/StartupServletExternalContextImpl.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/context/servlet/StartupServletExternalContextImpl.java
Fri Apr  1 20:26:47 2011
@@ -27,17 +27,9 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import javax.faces.context.Flash;
 import javax.servlet.ServletContext;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.myfaces.util.EnumerationIterator;
 
 /**
  * An ExternalContext implementation for Servlet environments, which is used
@@ -430,4 +422,20 @@ public class StartupServletExternalConte
         return _startup ? "startup" : "shutdown";
     }
 
+    @Override
+    public boolean isSecure()
+    {
+        throw new UnsupportedOperationException(EXCEPTION_TEXT + _getTime());
+    }
+
+    @Override
+    public int getSessionMaxInactiveInterval()
+    {
+        throw new UnsupportedOperationException(EXCEPTION_TEXT + _getTime());    }
+
+    @Override
+    public void setSessionMaxInactiveInterval(int interval)
+    {
+        throw new UnsupportedOperationException(EXCEPTION_TEXT + _getTime());
+    }
 }



Mime
View raw message