Announcement Announcement Module
No announcement yet.
Spring security with i18n Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring security with i18n

    Good evening everyone,

    I have a problem with Spring Security and i18n, in my application I have two languages, I like the page loaded properly with the language chosen, if the user has selected the French language he displays the login in French, he chose the English language the login page appears in English. I did the following example :

    <http auto-config="true">
    <intercept-url pattern="/admin.html?lang=fr" access="ROLE_USER" />
    <form-login login-page="/login.html?lang=fr"
    default-target-url="/admin.html?lang=fr" authentication-failure-url="/loginfailed.html?lang=fr" />
    <logout logout-success-url="/logout.html?lang=fr" />

    <intercept-url pattern="/admin.html?lang=en" access="ROLE_USER" />
    <form-login login-page="/login.html?lang=en"
    default-target-url="/admin.html?lang=en" authentication-failure-url="/loginfailed.html?lang=en" />
    <logout logout-success-url="/logout.html?lang=en" />

    but I still have the page in French. Because reading XML page is top to bottom, is there a way to add conditions,

    I need your help
    thank you very much.

  • #2
    Please use [ code][/code ] tags when posting.

    You are making it to complex and complicated. Spring Security uses the I18N support from spring, so I suggest a read of the normal spring reference guide on how to configure it (next to the section in the spring security manual). In short you don't need all this languages can be handled by the framework.


    • #3
      Thank you Marten


      • #4
        You might also look at the contacts sample application (in versions 3.1.0.M1 +) which demonstrates how to do internationalization.