/** * @return true if an exception has already been caught. */ public static boolean exceptionAlreadyCaught() { return ContextUtils.getSessionAttribute(EXCEPTION_MARKER_NAME) != null; }
/** * @param name * @return an attribute previously set by setDownloadAttribute(). */ public static Object getDownloadAttribute( final String name) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("getDownloadAttribute()"); for (String string : ContextUtils.getSessionAttributesStrings()) { LOGGER.debug(string); } } return ContextUtils.getSessionAttribute(name); }
/** * @return The exception service created when the exception had been thrown. */ public static ExceptionService getMarkedExceptionService() { Object marker = ContextUtils.getSessionAttribute(EXCEPTION_MARKER_NAME); if (marker != null && marker instanceof ExceptionService) { return (ExceptionService) marker; } return null; }
/** * @param name * @return an attribute previously set by setDownloadAttribute(). */ public static Object getDownloadAttribute( final String name) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("getDownloadAttribute()"); for (String string : ContextUtils.getSessionAttributesStrings()) { LOGGER.debug(string); } } return ContextUtils.getSessionAttribute(name); }
@Override protected Object getContextAttribute(final String name) { return ContextUtils.getSessionAttribute(name); }
/** * @param name * @return an attribute previously set by setDownloadAttribute(). */ public static Object getDownloadAttribute( final String name) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("getDownloadAttribute()"); for (String string : ContextUtils.getSessionAttributesStrings()) { LOGGER.debug(string); } } return ContextUtils.getSessionAttribute(name); }
/** * @return the locale stored in session. */ protected Locale getSessionLocale() { if (ContextUtils.isWeb()) { return (Locale) ContextUtils.getSessionAttribute(LOCALE_ATTRIBUTE); } return LocaleContextHolder.getLocale(); }
@Override public void beforePhase(final PhaseEvent event) { if (logger.isDebugEnabled()) { logger.debug("enterig RessourceBundlePhaseListener::beforePhase = " + event); } FacesContext context = event.getFacesContext(); try { Locale locale = (Locale) ContextUtils.getSessionAttribute(AbstractI18nAwareBean.LOCALE_ATTRIBUTE); if (locale == null && context.getViewRoot() != null) { locale = context.getViewRoot().getLocale(); } if (locale != null && context.getExternalContext().getRequestMap().get(DEFAULT_STRINGVAR) == null) { I18nService i18nService = (I18nService) BeanUtils.getBean("i18nService"); context.getExternalContext().getRequestMap().put( DEFAULT_STRINGVAR, i18nService.getStrings(locale)); } } catch (NoRequestBoundException e) { //do nothing logger.warn("in ResourceBundlePhaseListener::beforePhase NoRequestBoundException"); } }
@Override public void beforePhase(final PhaseEvent event) { if (logger.isDebugEnabled()) { logger.debug("enterig RessourceBundlePhaseListener::beforePhase = " + event); } FacesContext context = event.getFacesContext(); try { Locale locale = (Locale) ContextUtils.getSessionAttribute(AbstractI18nAwareBean.LOCALE_ATTRIBUTE); if (locale == null && context.getViewRoot() != null) { locale = context.getViewRoot().getLocale(); } if (locale != null && context.getExternalContext().getRequestMap().get(DEFAULT_STRINGVAR) == null) { TagsConfigurator tagsConfigurator = TagsConfigurator.getInstance(); context.getExternalContext().getRequestMap().put( DEFAULT_STRINGVAR, tagsConfigurator.getStrings(locale)); } } catch (NoRequestBoundException e) { //do nothing logger.warn("in ResourceBundlePhaseListener::beforePhase NoRequestBoundException"); } }
public User getUser() { try { AuthInfo authInfo = (AuthInfo) ContextUtils.getSessionAttribute(AUTH_INFO_ATTRIBUTE); if (authInfo != null) { User user = (User) ContextUtils.getSessionAttribute(USER_ATTRIBUTE); if (logger.isDebugEnabled()) { logger.debug("found auth info in session: " + user);
AuthInfo authInfo = (AuthInfo) ContextUtils.getSessionAttribute(AUTH_INFO_ATTRIBUTE); if (authInfo != null) { User user = (User) ContextUtils.getSessionAttribute(USER_ATTRIBUTE); if (logger.isDebugEnabled()) { logger.debug("found auth info in session: " + user);
try { AuthInfo authInfo = (AuthInfo) ContextUtils .getSessionAttribute(AUTH_INFO_ATTRIBUTE); if (authInfo != null) { User user = (User) ContextUtils .getSessionAttribute(USER_ATTRIBUTE); if (logger.isDebugEnabled()) { logger.debug("found auth info in session: " + user);