• Post Reply Bookmark Topic Watch Topic
  • New Topic

Not able to pass a Object Parameter value to the addProperty ...  RSS feed

 
Josephsrm Rajan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am using the VelocityEngine. My Code is

private VelocityEngine velocityEngine;

velocityEngine = new VelocityEngine();

Now I tried to invoke addProperty method to configure different properties. The signature of the method is addProperty(String key, Object Value).

when I tried to give the values directly I am able to access the file;

velocityEngine.addProperty("file.resource.loader.path","//myfilepath");

But my requirement is to pass a Parameter for the Object value. so I created a Object reference

Object objref = "//myfilepath";

Then I gave the objref to the addProperty method.

velocityEngine.addProperty("file.resource.loader.path", objref);

surprisingly i found that the code throws a ResourceNotFoundException.

A prompt response to fix this is highly appreciated.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!