spring - Thymeleaf: Use the text content as default if the message resolver fails -


I recently started using i18n with Thimmelef and Spring 4, like:

< Pre> & lt; Span th: text = "# {foo.bar}" & gt; Foo Bar & lt; / Span & gt;

Is there a way to display thymelef actually "foo bar" if the user is not having the foo.bar key for the location?

This is the current configuration I have:

  @bean public message processing message source () {reloadable resourcebundled message source message source = new reloadable resourcebundle Message Source (); MessageSource.setBasenames ("/ web-INF / messages / messages"); MessageSource.setUseCodeAsDefaultMessage (true); // something equal? MessageSource.setDefaultEncoding ("UTF-8"); MessageSource.setCacheSeconds (0); Return messages source; }  

The message source is the last resort to prevent CODEAsDefaultMessage properties an exception code Mapping Infidelity (If MessageSource can not find your code mapping, then this Noose Message throws an exception). This is for development and debugging, so there is no clear way to do this normally because it is not a good practice to use a defined message code anywhere.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -