Author: hfnukal
Date: 2011-07-28 08:18:49 -0400 (Thu, 28 Jul 2011)
New Revision: 6940
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/CacheUserProfileFilter.java
Log:
JBEPP-1005 OrganizationService lifecycle (and Hibernate transaction) always started in
CacheUserProfileFilter during HTTP request of anonymous user
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/CacheUserProfileFilter.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/CacheUserProfileFilter.java 2011-07-28
10:59:21 UTC (rev 6939)
+++
epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/CacheUserProfileFilter.java 2011-07-28
12:18:49 UTC (rev 6940)
@@ -27,6 +27,8 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.services.security.ConversationState;
+import org.exoplatform.services.security.IdentityConstants;
+import org.exoplatform.services.security.web.SetCurrentIdentityFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
@@ -44,14 +46,14 @@
/**
* Logger.
*/
- private static Log log =
ExoLogger.getLogger("core.security.SetCurrentIdentityFilter");
+ private static Log log = ExoLogger.getLogger(SetCurrentIdentityFilter.class);
public void doFilter(ServletRequest request, ServletResponse response, FilterChain
chain) throws ServletException
{
ConversationState state = ConversationState.getCurrent();
try
{
- if (state != null)
+ if (state != null &&
!state.getIdentity().getUserId().equals(IdentityConstants.ANONIM))
{
if (log.isDebugEnabled())
log.debug("Conversation State found, save user profile to
Conversation State.");
@@ -65,7 +67,6 @@
User user =
orgService.getUserHandler().findUserByName(state.getIdentity().getUserId());
end(orgService);
state.setAttribute(USER_PROFILE, user);
-
}
}
Show replies by date