Welcome in {} is displayed rather from the tag..Why this behaviour

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Welcome in {} is displayed rather from the tag..Why this behaviour

sreeni
This post was updated on .
Hi All I am using the following code to display Welcome to Security System:But The page is displaying as below: "??home.welcome_en_GB??" If I change # to @ Symbol, then it is displaying it as "home.welcome" But I want to Display "Welcome to Security System". I am new using Thymeleaf. Could you please advise on this. Thanks in Advance <!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'home')}"> < h2 th:text="#{home.welcome}">Welcome to Security System!< /h2 >
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Welcome in {} is displayed rather from the tag..Why this behaviour

Metroids
This: "#{stuff.goes.here}" means to search for messages that match that key.  If a message is not found, a default message (like '??msgKey??') is returned.  That's why you're seeing  "??home.welcome_en_GB??", it can't find the message.

This: "@{stuff.goes.here}" is a url expression.  it attempts to create a url from the string passed to it.  Since @{home.welcome} has no meaning, it just returns "home.welcome".  The @{} has a lot of different uses, but it doesn't do anything here.

So, you need to make sure you're messages files are all wired up correctly.
Loading...