I created an app with Roo and ran the "web mvc setup" command. I'm deleting the actual JSP views and tiles setup, etc as I'm replacing that with Thymeleaf.
This line is the default that Roo generates for a MessageSource and I've added some entries to WEB-INF/i18n/messages.properties, but they're not being picked up.
Here is a fragment from my view which checks to see if a list is empty, declares a variable who's value is a localized message in messages.properties so that it's available in the template called "empty-table".Code:<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource" p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application" p:fallbackToSystemLocale="false"/>
Here is my messages.propertiesCode:<div th:if="${#lists.isEmpty(activities)}" th:with="tableText=#{activities.noDataFound}"> <table th:substituteby="templates/empty-table :: empty-table"/> </div>
When I run my app, the message #{activities.noDataFound} isn't resolved, instead I get "??activities.noDataFound_en_US??". If I look at the console output when I run jetty, I can see my MessageSource is picked up and it shows the basenames indicated in the bean config, so shouldn't my message get resolved?Code:tables.noDataFound=No data found. activities.noDataFound=No activities found.


Reply With Quote