You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2003/03/18 19:00:50 UTC

DO NOT REPLY [Bug 18118] New: - VelocityGenerator resource loader properties are ignored

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18118>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18118

VelocityGenerator resource loader properties are ignored

           Summary: VelocityGenerator resource loader properties are ignored
           Product: Cocoon 2
           Version: 2.0.4
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: general components
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: andrew.speakman@ahds.ac.uk


Invoking the Velocity file loader like this
<resource-loader name="file" 
class="org.apache.velocity.runtime.resource.loader.FileResourceLoader"> 
      		<property name="path" value="/path/to/templates" />
</resource-loader>

The properties are not loaded and the generator fails because there is an
error in the for loop of the configure() method which loads the properties, 
as follows:-

Configuration [] loaderProperties = loader.getChildren("property");
            for (int j=0; i < loaderProperties.length; ++j)
        {
                Configuration c = loaderProperties[j];
                String propName = c.getAttribute("name");
                this.tmplEngine.setProperty(prefix + propName, c.getAttribute
("value"));
            }

Note the variable 'i' in the test part of the for loop -> it should be 'j'