aspose file tools*
The moose likes Spring and the fly likes  spring security messages 3.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark " spring security messages 3.1" Watch " spring security messages 3.1" New topic
Author

spring security messages 3.1

Luis Parente
Ranch Hand

Joined: Jan 17, 2012
Posts: 39
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.














Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

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



[How To Ask Questions][Read before you PM me]
Luis Parente
Ranch Hand

Joined: Jan 17, 2012
Posts: 39
Hi thanks for your response.


it's work


The language is french
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: spring security messages 3.1