在ValidationMessages.properties中写中文会乱码将文件改为UTF-8编码 然后在application.properties 中设置spring.messages.encoding=UTF-8 ,在idea中输入spring.messages.encoding 时会自动提示spring.messages.encoding=UTF-8 我以为默认就是UTF-8,其实不是的要手动声明好坑哇
image
image.png
image
image
在ValidationMessages.properties中写中文会乱码将文件改为UTF-8编码 然后在application.properties 中设置spring.messages.encoding=UTF-8 ,在idea中输入spring.messages.encoding 时会自动提示spring.messages.encoding=UTF-8 我以为默认就是UTF-8,其实不是的要手动声明好坑哇