You should try LOCALIZING SPRING SAFETY MESSAGES .
Try adding these lines to your ApplicationContext.xml file. Where is your remaining protection SPRING beans.
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename" value="yourFolder/myMessages"/> </bean>
You should find your default SPRING class, which is stored <KEY, MESSAGE> . Create a myMessage file with the same KEY and localized MESSAGE s.
Based on your comment, you have
messages.properties in your project. So, all you have to do is have a
MESSAGE for each of these keys inside this properties file in order to have fully localized messages:
AbstractAccessDecisionManager.accessDenied= your message in any language AbstractSecurityInterceptor.authenticationNotFound= AbstractUserDetailsAuthenticationProvider.badCredentials= AbstractUserDetailsAuthenticationProvider.credentialsExpired= AbstractUserDetailsAuthenticationProvider.disabled= AbstractUserDetailsAuthenticationProvider.expired= AbstractUserDetailsAuthenticationProvider.locked= AbstractUserDetailsAuthenticationProvider.onlySupports= AccountStatusUserDetailsChecker.credentialsExpired= AccountStatusUserDetailsChecker.disabled= AccountStatusUserDetailsChecker.expired= AccountStatusUserDetailsChecker.locked= AclEntryAfterInvocationProvider.noPermission= AnonymousAuthenticationProvider.incorrectKey= BindAuthenticator.badCredentials= BindAuthenticator.emptyPassword= CasAuthenticationProvider.incorrectKey= CasAuthenticationProvider.noServiceTicket= ConcurrentSessionControlStrategy.exceededAllowed= DigestAuthenticationFilter.incorrectRealm= DigestAuthenticationFilter.incorrectResponse= DigestAuthenticationFilter.missingAuth= DigestAuthenticationFilter.missingMandatory= DigestAuthenticationFilter.nonceCompromised= DigestAuthenticationFilter.nonceEncoding= DigestAuthenticationFilter.nonceExpired= DigestAuthenticationFilter.nonceNotNumeric= DigestAuthenticationFilter.nonceNotTwoTokens= DigestAuthenticationFilter.usernameNotFound= JdbcDaoImpl.noAuthority= JdbcDaoImpl.notFound= LdapAuthenticationProvider.badCredentials= LdapAuthenticationProvider.credentialsExpired= LdapAuthenticationProvider.disabled= LdapAuthenticationProvider.expired= LdapAuthenticationProvider.locked= LdapAuthenticationProvider.emptyUsername= LdapAuthenticationProvider.onlySupports= PasswordComparisonAuthenticator.badCredentials= PersistentTokenBasedRememberMeServices.cookieStolen= ProviderManager.providerNotFound= RememberMeAuthenticationProvider.incorrectKey= RunAsImplAuthenticationProvider.incorrectKey= SubjectDnX509PrincipalExtractor.noMatching= SwitchUserFilter.noCurrentUser= SwitchUserFilter.noOriginalAuthentication=
source share