我有一个问题宽度这段代码:设置类路径资源
final Map<String, File> attachments = new HashMap<>();
\t \t final Map<String, String> inlineResources = new HashMap<String, String>();
\t \t inlineResources.put("logo", "/res/img/IN_payoff.png");
\t \t for (File certificateFile : certificates) {
\t \t \t attachments.put(certificateFile.getName(), certificateFile);
\t \t }
\t \t YadaEmailParam p = new YadaEmailParam();
\t \t
\t \t p.inlineResources = inlineResources;
\t \t yadaEmailService.sendHtmlEmail(p);
\t }
此错误:
org.springframework.mail.MailSendException: Failed messages: javax.mail.MessagingException: IOException while sending message;
nested exception is:
\t java.io.FileNotFoundException: class path resource [res/img/IN_payoff.png] cannot be opened because it does not exist
如何设置类路径?
不,这不是一个Maven项目。它是GitLab的一个Java项目。这个html文件是src/main/resources中的模板邮件,img是src/res/img –