If you are using Velocity in a webapp, you should use the WebappResourceLoader that is a part of the VelocityTools-VelocityView subproject, instead of using the FileResourceLoader.
Webapps w/Velocity - http://jakarta.apache.org/velocity/webapps.html VelocityView - http://jakarta.apache.org/velocity/tools/view/ WebappResourceLoader - http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/view/servlet/WebappLoader.html Configuring Resource Loaders - http://jakarta.apache.org/velocity/docs/developer-guide.html#Configuring%20Resource%20Loaders On 21 Jul 2006 13:27:11 -0000, vadivu sushma subbiah <[EMAIL PROTECTED]> wrote:
Hi, I have 5 velocity templates files in webapp path (for eg. com/abc/cd/) depending upon the condition, i need to select a template. if i place the templates in my machine specific path (for eg. d:/oc4j/j2ee/home), i am able to get the template depending on the condition using the following syntax.. final String CONFIG_DIR = "D:\\oc4j\\j2ee\\home\\"; Velocity.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH,CONFIG_DIR ); Velocity.getTemplate(selectedTemplate); if i place the templates in webapp path, i am unable to access the template files.. it is saying "unable to find resource" may i know the webapp location to place the templates and syntax to access those template(.vm) files. Thanks
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]