• Post Reply Bookmark Topic Watch Topic
  • New Topic

Facing exception while using Apache Velocity in JSF  RSS feed

 
Rahul Shivsharan
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Brendan Healey
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

Regards,
Brendan.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!