Author: pyaschenko
Date: 2011-04-01 10:25:18 -0400 (Fri, 01 Apr 2011)
New Revision: 22351
Added:
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/SessionBeansFilter.java
Modified:
branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml
Log:
https://issues.jboss.org/browse/RF-10841
Added:
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/SessionBeansFilter.java
===================================================================
---
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/SessionBeansFilter.java
(rev 0)
+++
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/SessionBeansFilter.java 2011-04-01
14:25:18 UTC (rev 22351)
@@ -0,0 +1,29 @@
+package org.richfaces.demo.filters;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.util.Enumeration;
+
+/**
+ * User: Gleb Galkin
+ * Date: 31.03.11
+ */
+public class SessionBeansFilter implements Filter {
+ public void init(FilterConfig filterConfig) throws ServletException {
+ }
+
+ public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
FilterChain filterChain) throws IOException, ServletException {
+ HttpSession session = ((HttpServletRequest) servletRequest).getSession();
+ Enumeration attributes = session.getAttributeNames();
+ while (attributes.hasMoreElements()) {
+ String attribute = (String) attributes.nextElement();
+ session.setAttribute(attribute, session.getAttribute(attribute));
+ }
+ filterChain.doFilter(servletRequest, servletResponse);
+ }
+
+ public void destroy() {
+ }
+}
Modified: branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml
===================================================================
---
branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml 2011-03-31
19:54:02 UTC (rev 22350)
+++
branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml 2011-04-01
14:25:18 UTC (rev 22351)
@@ -101,6 +101,16 @@
<servlet-name>_ah_sessioncleanup</servlet-name>
<url-pattern>/_ah/sessioncleanup</url-pattern>
</servlet-mapping>
+ <filter>
+ <filter-name>SessionBeansFilter</filter-name>
+ <filter-class>
+ org.richfaces.demo.filters.SessionBeansFilter
+ </filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>SessionBeansFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>session-cleanup</web-resource-name>