• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

spring security messages 3.1

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,


In my code, I have the following lines: (my local is fr)



But the message in my page is the message by default:

L'identification a échoué, veuillez vous identifier à nouveau. Raison : Le nom dutilisateur {0} na pas été trouvé .

And the parameter {0} isn't replaced by username....


I need a little help please.


Thanks in advance.














 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you defining your MessageSource?

Typically you would set the base in that configuration and then have a file somewhere like

messages_en_US.properties (I chose US just because I have no idea what language that is )

which would in turn contain

DigestAuthenticationFilter.usernameNotFound=Utilisateur {0} non paramétré en base


Now when you access it you would do so like this:



Now that last String argument you provided is a default message which will be used if the lookup fails. In this case that String will be printed as is (no replacement is done) which is the behavior you are seeing.

for example

 
Luis Parente
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi thanks for your response.


it's work


The language is french
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Luis Parente wrote:Hi thanks for your response.


it's work


The language is french



Or in French, I think

C'est travaillez.

Or close to that. I think?

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic