* Logger.
*/
private static Log log = ExoLogger.getLogger(CacheUserProfileFilter.class);
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException {
ConversationState state = ConversationState.getCurrent();
try {
if (state != null && !state.getIdentity().getUserId().equals(IdentityConstants.ANONIM)) {
if (log.isDebugEnabled())
log.debug("Conversation State found, save user profile to Conversation State.");
if (state.getAttribute(USER_PROFILE) == null) {
OrganizationService orgService = (OrganizationService) getContainer().getComponentInstanceOfType(
OrganizationService.class);
begin(orgService);
User user = orgService.getUserHandler().findUserByName(state.getIdentity().getUserId(), UserStatus.ANY);
end(orgService);
state.setAttribute(USER_PROFILE, user);
}
}
chain.doFilter(request, response);
} catch (Exception e) {