Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring Thymeleaf找不到国际化邮件_Spring_Spring Boot_Internationalization_Thymeleaf - Fatal编程技术网

Spring Thymeleaf找不到国际化邮件

Spring Thymeleaf找不到国际化邮件,spring,spring-boot,internationalization,thymeleaf,Spring,Spring Boot,Internationalization,Thymeleaf,我试着在谷歌上搜索,但找不到任何解决问题的方法 代码的链接是 我在运行JUnit测试com.jk.th.mail.util.MailTemplateTest.java时得到以下输出: ---------------------------------------------- * Mail contents * ---------------------------------------------- Recipients: def@mail.com Subject

我试着在谷歌上搜索,但找不到任何解决问题的方法

代码的链接是

我在运行JUnit测试
com.jk.th.mail.util.MailTemplateTest.java
时得到以下输出:

----------------------------------------------
             * Mail contents *
----------------------------------------------
Recipients: def@mail.com
Subject: Complete registraion process
Message: 
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>??subject.registration.complete_en_US??</title>
</head>

<body>
    <p>??grettings.user_en_US??</p>

    <p>??registration.text.line1_en_US??</p>

    <p>
        <a href="https://www.example.com/completeRegistration">??registration.link.text_en_US??</a>
    </p>

    <p>??registration.text.line2_en_US??</p>

    <div>
        <p>
            <span>??thanks_en_US??</span><br/>
            <span>??pustakalaya.team_en_US??</span><br/>
            <span>??contact.mail_en_US??</span><br/>
            <span>??contact.number_en_US??</span>
        </p>
    </div>

</body>
</html>
----------------------------------------------
----------------------------------------------
*邮件内容*
----------------------------------------------
收件人:def@mail.com
主题:完成注册过程
信息:
??受试者。注册。完成??
?grettings.用户

??注册。文本。行1\u en\u US

??注册。文本。行2\u en\u US

??谢谢你,谢谢你 ?pustakalaya。团队成员??
??联系方式。邮件发送给我们???
??联系方式。联系电话号码??

----------------------------------------------
我不确定您编写配置的方式有哪些地方不正确,但是。。。 由于您仍在使用默认路径,因此可以删除该调用(在
SpringMailConfig.springTemplateEngine()
中):


然后您还可以删除bean
messageResolver
emailMessageSource


执行此操作后,唯一未解析的消息将是“grettings”(因为拼写错误)。

您的问题是什么?
emailMessageSource
是问题的根源。当我移除它时,它起作用了。知道吗,为什么?
templateEngine.setMessageResolver(messageResolver());