ai moçada por favor, preciso de uma ajuda…
o meu Template ñ encontra o meu file… e apresenta esse erro…
Exception in thread "main" org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'src/ant/template.vm'
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:483)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:354)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1400)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1380)
at org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:401)
at w3s.lab13.MainLab13.main(MainLab13.java:15)
o meu codigo é esse…
VelocityEngine ve = new VelocityEngine();
ve.setProperty("file.resource.loader.path", "d:/templates/");
ve.init();
Template t = ve.getTemplate("src/ant/template.vm");
VelocityContext context = new VelocityContext();
context.put("users", "stes");
StringWriter writer = new StringWriter();
t.merge(context, writer);
System.out.println(writer.toString());
de fato file esta no diretorio q estou passando, mas ainda assim ele ñ encontra-o
o q a de errado ?