Hi Leon, Sorry I think I wasn't clear. I do not wish to use Velocity, all my views are Freemarker or JSP based. I have found that it seems to be the Struts2 Sitemesh plugin that causes problems. As soon as I declare it then I get NoClassDefFound problems until I manually add the Velocity dependencies? Are they needed to run the Sitemesh plugin? They are marked as optional in the plugin POM and I would rather not have to include them.
Thanks, Martin. ----- Original message ----- From: "Leonidas Papadakis" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <user@struts.apache.org> Date: Mon, 24 Sep 2007 17:38:16 +0300 Subject: Re: Velocity dependency Hi there, i had to do the following things in order to add full velocity support. The issue is that in struts2 even if you have to parse a velocity file, it has to be a result of an action. So in order to be able to parse velocity files even if they are not result of an action : Add the following to web.xml: <servlet> <servlet-name>velocity</servlet-name> <servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- if you want another file mapping --> <servlet-mapping> <servlet-name>velocity</servlet-name> <url-pattern>*.shtml</url-pattern> </servlet-mapping> Add the following jar files to lib folder : velocity-dep-1.4.jar velocity-tools-1.1.jar Regards, Leon Martin Gilday wrote: > I am porting a WebWork application over to Struts2. I have added a > dependency to struts2-core to my Maven POM. > <dependency> > <groupId>org.apache.struts</groupId> > <artifactId>struts2-core</artifactId> > <version>2.0.9</version> > </dependency> > > In my struts.xml I extend struts-default. When I try and start my > application I get a ClassDefNotFoundException. Is Velocity required > when extending struts-default? This was not the case in WW where > Freemaker was always the default. If it is required is there a reason > it is not a dependency in the struts-core POM? > > 2007-09-24 13:14:06.993::WARN: Error starting handlers > java.lang.NoClassDefFoundError: org/apache/velocity/app/VelocityEngine > at java.lang.Class.getDeclaredFields0(Native Method) > at java.lang.Class.privateGetDeclaredFields(Class.java:2291) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]