Announcement Announcement Module
Collapse
No announcement yet.
Security messages and LocalChangeInterceptor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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, 10:29 AM.

      Comment


      • #4
        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.

        Comment


        • #5
          Thanks a lot, i will try it.

          Comment


          • #6
            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

            Comment


            • #7
              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.

              Comment

              Working...
              X