• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with velocity templates

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I'm developing a project with two separate webapps using struts+velocity+jboss.
I've noticed that when I deploy both webapps velocity gets confused and retrieve wrong templates.
In fact, when I access index.vm in webapp_1 I get index.vm of webapp_2.
Reading velocity docs I've figured out VelocityViewServlet uses a singleton model, wich could be why I have this problem.
In both webapps the web.xml looks like this :

Does anyone know why velocity doesn�t looks for the templates in the wright place? Maybe I have something wrong in the configuration?
Is there any way of using velocity in two independent webapps, each using .vm templates in its WAR file?
Thanks in advance.
Greetings, Pablo.
 
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pablo,
I don't have any experience with Velocity in webapps at this point but it very well might be that Velocity can't find the properties files. You probably need to place them in /WEB-INF/classes instead of /WEB-INF so they are on the classpath. That's my best guess.
 
reply
    Bookmark Topic Watch Topic
  • New Topic