Bir şeyler yanlış ve çok sinir bozucu. Bir webapp çalıştırdığımda, bazı özelliklerin ayarlanması gerektiğini hız sayfasının ana sayfasında okudum. Ve bunu yaptım ama ne yaparsam yapayım aynı hatayı almaya devam ediyorum. BenVelocity şu sorguyu bulamıyor
public class ConfirmationMailGenerator implements MailGenerator {
private BasicUser user;
private String htmlTemplate = "HTMLConfirmationMailTemplate.vsl";
private String plainTemplate = "PlainConfirmationMailTemplate.vsl";
public ConfirmationMailGenerator(BasicUser user) {
this.user = user;
}
public StringWriter generateHTML() throws Exception {
Properties props = new Properties();
props.setProperty("resource.loader", "wepapp");
props.setProperty("webapp.resource.loader.class", "org.apache.velocity.tools.view.WebappResourceLoader");
props.setProperty("webapp.resource.loader.path", "/WEB-INF/mailtemplates/");
VelocityEngine engine = new VelocityEngine(props);
VelocityContext context = new VelocityContext();
engine.init();
Map map = createDataModel();
context.put("user", map);
Template template = engine.getTemplate(htmlTemplate);
StringWriter writer = new StringWriter();
template.merge(context, writer);
return writer;
}
...
}
dosyaları/WEB-INF/mailtemplates/kaydedilen elbette sahne ve kullanım hızını ayarlamak nerede
budur. Bunu kullanırsanız
bu hatayı alıyorum:
SEVERE: ResourceManager : unable to find resource 'HTMLConfirmationMailTemplate.vsl' in any resource loader.
SEVERE: The log message is null.
:)
@Will Glass, kodunuzu nereye yazacağınızı lütfen açıklayın – gstackoverflow