Results 1 to 7 of 7

Thread: Security messages and LocalChangeInterceptor

  1. #1
    Join Date
    Mar 2010
    Location
    Madrid
    Posts
    13

    Default Security messages and LocalChangeInterceptor

    Hello.

    Is there any way of configuring spring security messages with localized messages using a org.springframework.web.servlet.i18n.LocaleChangeI nterceptor?

    I mean, my internalizations works fine in general, using
    Code:
    <mvc:interceptors>
    	 <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
            <property name="paramName" value="lang" /> 
         </bean>
    	</mvc:interceptors>
        <bean id="messageSource"
           class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
         <property name="basename" value="/WEB-INF/messages/messages"/>
        </bean>

    But i canīt change security messages languaje as i do with my normal pages. It always takes into accout browser languaje. Is there any way of changging this behaviour?

    Thanks in advance.

  2. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    Search the forum (e.g. for "locale"). You will find this has been discussed before. There is also a section on localization in the manual.
    Spring - by Pivotal
    twitter @tekul

  3. #3
    Join Date
    Mar 2010
    Location
    Madrid
    Posts
    13

    Default

    Thanks, Iīve already read manuals and search in forums.

    As i said my internalizations works fine, but it doesnīt work for Spring Security Messages as i want to. I was trying to return Security messages in the languaje used in the the request as ?lang=es
    Last edited by mooniatico; Feb 16th, 2011 at 10:29 AM.

  4. #4
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    Did you read this thread?

    LocaleChangeInterceptor has no bearing on Spring Security filters since Spring Security isn't part of Spring MVC.

    If that isn't what you mean, please explain what you have done to try to change the messages, what is the observed behaviour and what you want to happen instead.
    Spring - by Pivotal
    twitter @tekul

  5. #5
    Join Date
    Mar 2010
    Location
    Madrid
    Posts
    13

    Default

    Thanks a lot, i will try it.

  6. #6

    Default

    Hi Luke,
    I believe I am in the same boat as mooniatico.
    Web application using spring 3.0.5, spring security 3.0.5, webflow 2.3.0.

    I am doing the i8n using parameters (&locale=fr) and LocaleChangeInterceptor / SessionLocaleResolver
    The i8n works fine for all webflow related messages but I can't seem to get the spring security exceptions to use the same approach. When I change the locale browser setting the exceptions are then shown in the correct locale.

    Can spring security be used for i8n using the locale parameter approach.

    Thanks

  7. #7
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    Please read my previous reply and the referenced thread.

    LocaleChangeInterceptor is part of Spring MVC and will not have any effect on filters which are run before the dispatcher servlet.
    Spring - by Pivotal
    twitter @tekul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •