FAQ
fileloader in front of a classpath loader doesn't respond to runtime addition of template
-----------------------------------------------------------------------------------------

Key: VELOCITY-702
URL: https://issues.apache.org/jira/browse/VELOCITY-702
Project: Velocity
Issue Type: Bug
Components: Engine
Affects Versions: 1.6.1
Environment: Linux, Sun Java 1.5
Reporter: chad davis


I'm using a file resource loader followed by a classpath resource loader. I want the templates in the file location to override the templates on the classpath. This works partially. If a template with the same name is in both locations, it definitely picks up the one in the file system. If I remove the filesystem template, during run time, the template on the classpath is then found. So far, so good. If I then, however, try to put the template back in the file system location, it is NOT picked up.

Note, this is all during run time. If I restart my app ( a web application -- not using the velocity servlet ), the filesystem template is again picked up.


Here is my configuration:

#resource.loader=class
resource.loader=file, class

# File resource loader information
#
file.resource.loader.description=Velocity File Resource Loader
file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.cache=true
file.resource.loader.modificationCheckInterval=1
file.resource.loader.path=/home/readyportal/Desktop/machineOneWorkspaces/bipSpace/BIP/src/wego/velocity/templates/

#file.resource.loader.path=/home/readyportal/ReadyPortal/conf/velocity/templates/

#
# Class resource loader information
#
class.resource.loader.description=Velocity Classpath Resource Loader
class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
class.resource.loader.cache=true
class.resource.loader.modificationCheckInterval=1


Other notes:

If I turn the caching off on the classpath resource loader ( i.e.
change only the class.resource.loader.cache to false in the above
config ), everything works at runtime.



--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org

Search Discussions

  • Anonymous at Feb 19, 2009 at 7:01 am
    [ https://issues.apache.org/jira/browse/VELOCITY-702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Nathan Bubna closed VELOCITY-702.
    ---------------------------------

    Resolution: Fixed
    Fix Version/s: 2.0
    1.7
    1.6.2

    This was because refreshResource didn't pay attention to which loader the resource came from and thus didn't re-check higher priority loaders once the resource was found and cached from a lower priority loader.

    Fixed in all versions.
    fileloader in front of a classpath loader doesn't respond to runtime addition of template
    -----------------------------------------------------------------------------------------

    Key: VELOCITY-702
    URL: https://issues.apache.org/jira/browse/VELOCITY-702
    Project: Velocity
    Issue Type: Bug
    Components: Engine
    Affects Versions: 1.6.1
    Environment: Linux, Sun Java 1.5
    Reporter: chad davis
    Fix For: 1.6.2, 1.7, 2.0


    I'm using a file resource loader followed by a classpath resource loader. I want the templates in the file location to override the templates on the classpath. This works partially. If a template with the same name is in both locations, it definitely picks up the one in the file system. If I remove the filesystem template, during run time, the template on the classpath is then found. So far, so good. If I then, however, try to put the template back in the file system location, it is NOT picked up.
    Note, this is all during run time. If I restart my app ( a web application -- not using the velocity servlet ), the filesystem template is again picked up.
    Here is my configuration:
    #resource.loader=class
    resource.loader=file, class
    # File resource loader information
    #
    file.resource.loader.description=Velocity File Resource Loader
    file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
    file.resource.loader.cache=true
    file.resource.loader.modificationCheckInterval=1
    file.resource.loader.path=/home/readyportal/Desktop/machineOneWorkspaces/bipSpace/BIP/src/wego/velocity/templates/
    #file.resource.loader.path=/home/readyportal/ReadyPortal/conf/velocity/templates/
    #
    # Class resource loader information
    #
    class.resource.loader.description=Velocity Classpath Resource Loader
    class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    class.resource.loader.cache=true
    class.resource.loader.modificationCheckInterval=1
    Other notes:
    If I turn the caching off on the classpath resource loader ( i.e.
    change only the class.resource.loader.cache to false in the above
    config ), everything works at runtime.
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
    For additional commands, e-mail: dev-help@velocity.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriesvelocity
postedFeb 18, '09 at 12:39a
activeFeb 19, '09 at 7:01a
posts2
users1
websitevelocity.apache.org

1 user in discussion

Anonymous: 2 posts

People

Translate

site design / logo © 2021 Grokbase