I am trying to get Apache Velocity up and running. I have a TestClass.class
class in my my.test.package
package.
public class TestClass {
public static Template getTestTemplate() throws Exception {
Velocity.init();
return Velocity.getTemplate("MyTestTemplate.vm");
}
}
In the same location (my.test.package
) I have the MyTestTemplate.vm
file.
The above code causes an exception to be thrown, saying Unable to find resource 'MyTestTemplate.vm'
. I am not sure what the issue is. Does Velocity not look for the file in the same package? (Note: I originally had the file in the resources folder, but put it under the same folder for testing purposes).