java - Messages from .properties file do not display UTF-8 characters -


In the form of a title, I can only add that if I enter the html file manually, then it Okay.

View Rolver:

  & lt; Bean id = "templorellolver" class = "org.thymeleaf.templateresolver.ServletContextTemplateResolver" & gt; & Lt; Property name = "prefix" value = "/ web-nf / templates" /> & Lt; Property name = "suffix" value = ". Html" /> & Lt; Property Name = "Template Mode" Value = "HTML5" /> & Lt; Asset name = "cacheable" value = "wrong" /> & Lt; Property Name = "characterEncoding" value = "UTF-8" /> & Lt; / Bean & gt; & Lt; Bean id = "Template Engine" class = "org.thymeleaf.spring3.SpringTemplateEngine" & gt; & Lt; Property Name = "Temploreolar" ref = "Templarolver" /> & Lt; / Bean & gt; & Lt; Bean square = "org.thymeleaf.spring3.view.ThymeleafViewResolver" & gt; & Lt; Property Name = "Template Engine" Ref = "Template Engine" /> & Lt; Property Name = "characterEncoding" value = "UTF-8" /> & Lt; Property Name = "Order" Value = "1" /> & Lt; / Bean & gt;  

pom.xml:

  & lt; Project.build.sourceEncoding & gt; UTF-8 & lt; /project.build.sourceEncoding> Example of HTML input  
  & lt; H2 & gt; & Lt; P: text = "# {homepage.greeting}" & gt; Welcome & lt; / P & gt; & Lt; / H2 & gt;  

   inside the tag of the HTML file < Meta charset = "UTF-8" /> In IntelliJ Idea, I have set the default encoding for property files for project encoding UTF-8, UTF-8  Enter image details here   

And I honestly do not know where the problem is when I change the locale, this output is: Enter image details here

Sorry but I can not post pictures yet

  & lt; Filter & gt; Any help would be appreciated.  

& lt; Filter-name & gt; EncodingFilter & lt; / Filter-name & gt; & Lt; Filter range & gt; Org.springframework.web.filter.CharacterEncodingFilter & lt; / Filter range & gt; & Lt; Init-param & gt; & Lt; Ultimate Name & gt; Encoding & lt; / Lastname & gt; & Lt; Ultimate Price & gt; UTF-8 & lt; / Super-valued & gt; & Lt; / Init-param & gt; & Lt; Init-param & gt; & Lt; Ultimate Name & gt; ForceEncoding & lt; / Lastname & gt; & Lt; Ultimate Price & gt; True & lt; / Super-valued & gt; & Lt; / Init-param & gt; & Lt; / Filter & gt; & Lt; Filter-mapping & gt; & Lt; Filter-name & gt; EncodingFilter & lt; / Filter-name & gt; & Lt; URL pattern & gt; / * & Lt; / URL pattern & gt; & Lt; / Filter-mapping & gt;

OK, I understand that the deal here is:

I had the following code:

  & lt; Bean id = "messageSource" class = "org.springframework.context.support.ResourceBundleMessageSource" & gt; & Lt; Property Name = "BaseName" value = "Message" /> & Lt; / Bean & gt;  

Option 1: Add it as another property:

  & lt; Property Name = "Default Encoding" value = "UTF-8" />  

Option 2: It has been replaced by:

  & lt; Bean id = "messageSource" class = "org.springframework. Context.support.ReloadableResourceBundleMessageSource" & gt; & Lt; Property Name = "BaseName" value = "Classpath: Message" /> & Lt; Property Name = "Default Encoding" value = "UTF-8" /> & Lt; / Bean & gt;  

If you change it to reload, keep in mind to change the asset value from "message" to "classpath: message". If for some reason I can not change it then the message bundle could not be found.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -