0

I have a Java program, to call a velocity template from dotcms. I need to know where to place the vm file and how to locate in Java. I am using this link.

http://www.javaworld.com/article/2075966/core-java/start-up-the-velocity-template-engine.html

MWiesner
  • 8,868
  • 11
  • 36
  • 70
Raghavenda Bhat
  • 155
  • 1
  • 12
  • The vm file has to be placed in the classpath. I assume there is something like "java.exe -classpath... package.MainClass". Try something like this: "java.exe -classpath path_to_your_vm_file,some_other_files package.Main.Class". – chris Sep 09 '16 at 11:54
  • Have you tried using any code to attempt just opening the file? I don't see how velocity specifically relates to the question – OneCricketeer Sep 09 '16 at 13:21
  • opening a file in java is fine. But when it comes to velocity, the engine has to locate the file properly. – Raghavenda Bhat Sep 09 '16 at 13:25

1 Answers1

0

I found out the solution. We can place it any where inside web-inf folder.

The link was helpful :

http://www.javaworld.com/article/2075966/core-java/start-up-the-velocity-template-engine.html

and path can be, path = "/xxx/xxx/xxx/xxx/xxx.vm";

Raghavenda Bhat
  • 155
  • 1
  • 12