aspose file tools
The moose likes JSF and the fly likes Facing exception while using Apache Velocity in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Facing exception while using Apache Velocity in JSF " Watch "Facing exception while using Apache Velocity in JSF " New topic
Author

Facing exception while using Apache Velocity in JSF

Rahul Shivsharan
Ranch Hand

Joined: Jun 17, 2009
Posts: 83
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

Joined: May 12, 2009
Posts: 218

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
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14487
    
    7

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Facing exception while using Apache Velocity in JSF
 
Similar Threads
Velocity + Struts2 + Sitemesh + Spring +Hibernate Integration How to configur web.xml?
navigation problems
Journal Article - Velocity - An Introduction
Loading Velocity Templates in Tomcat Applications
Problem with velocity templates