Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Facing exception while using Apache Velocity in JSF

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 24843
174
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You have to be odd to be #1 - Seuss. An odd little ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic