public static Map < String , Locale > getEnabledLocales ( ServletRequest request ) { @ SuppressWarnings ( "unchecked" ) Map < String , Locale > enabledLocales = ( Map < String , Locale > ) request . getAttribute ( ENABLED_LOCALES_REQUEST_ATTRIBUTE_KEY ) ; if ( enabledLocales == null ) throw new IllegalStateException ( "Not in request filtered by LocaleFilter, unable to get enabled locales." ) ; return enabledLocales ; }
Gets the set of enabled locales for the provided request . This must be called from a request that has already been filtered through LocaleFilter . When container s default locale is used will return an empty map .