Facing exception while using Apache Velocity in JSF
Joined: Jun 17, 2009
i'm working on a JSF project,
I am working on a functionality where on click of a button in managed-bean i have to lookup a velocity template "SDVL_TEMPLATE.vm" and put the key values,
the .vm file resides in "WEB-INF/template/" path
in web.xml i have done the following setting,
velocity.properties resides in WEB-INF, it has following entries,
and in my managed-bean, in the button invokation method i have done this,
But still in server console i get ResourseNotFound Exception, for SDVL_TEMPLATE.vm file.
Please can any body tell me where i am going wrong
Joined: May 12, 2009
I really don't know anything about Velocity (although I'm quite interested to find out) but this is likely to be a simple
"wrong path" problem. The best way to solve it is with a decent web browser such as chrome/firefox and bring up
the developer tools, click on the network tab and reload the page.
You should see the resource that's causing problems highlighted in red, then click on it to see the URL, then compare
this with something that is loading correctly, then think about where the resource resides within the application and
try and piece it all together.
I have, alas, a major application that mixes Velocity and JSF. However it does not attempt to invoke Velocity from JSF - all of the Velocity code is legacy stuff invoked from servlets. VTL is a less-functional disappointment compared to JSF EL, and eventually I expect to completely phase out Velocity.
My velocity.properties file is located in the WEB-INF/classes directory, and is therefore directly accessible via the classloader. A quick check of the master Velocity config code seems to indicate that Velocity knows where to pick it up without guidance from me.
Customer surveys are for companies who didn't pay proper attention to begin with.