velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abdallah Salah Raiyan <abdallahrai...@gmail.com>
Subject #include script for local file is failed
Date Sun, 16 Oct 2005 08:25:37 GMT
Hi all,
 I am trying to use the #include script in the Template to import a local
file (javaScript file):
 <!--TextArea.vm - begin-->
........
#include( "file.js" )
<textarea value="$!wrt.value" ...........>
$!wrt.htmlBody
</textarea>
...............
<!--TextArea.vm - end-->
 The file is located under the TEMPLATE_ROOT which i configure it in the
velocity.properties:
 .........
resource.loader = fileResource, classResource
#---------File path--Loader-----------------
fileResource.resource.loader.description = Velocity File Resource Loader
fileResource.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
fileResource.resource.loader.path = framework/web/velocity/template
fileResource.resource.loader.cache = true
fileResource.resource.loader.modificationCheckInterval = 2
#---------Classpath--Loader-----------------
classResource.resource.loader.description = Velocity Classpath Resource
Loader
classResource.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
...........
 Is that what i set for the TEMPLATE_ROOT in the velocity.properties OK.!!!?
 So i get the following ResourceNotFoundException:
 org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'MyJsFile.js'
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(
ResourceManagerImpl.java:458)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(
ResourceManagerImpl.java:341)
at org.apache.velocity.runtime.RuntimeInstance.getContent(
RuntimeInstance.java:868)
at org.apache.velocity.runtime.directive.Include.renderOutput(Include.java
:193)
at org.apache.velocity.runtime.directive.Include.render(Include.java:137)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(
ASTDirective.java:114)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(
ASTIfStatement.java:70)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java
:230)
at org.apache.velocity.Template.merge(Template.java:256)
 Any Suggestion..!!

Thanks in Advance
Abdallah

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message