This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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.
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.
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg