Able to find class file in WEB-INF/classes but not after add sub folders in class dir
Greetings,
i'm now struggling with velocity for a day now. Currently i am able to run velocity when the class file is in WEB-INF/classes directory.
However, my project need to add in sub directories in the classes folder for easier management.
eg: WEB-INF/classes/com/velocity/velocityObj/<the class file in here>
This is my web xml
Code:
<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<description>Empty web.xml file for Web Application</description>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
<servlet>
<servlet-name>VelocityTest</servlet-name>
<servlet-class>com.velocity.velocityObj.velocityTest</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>VelocityTest</servlet-name>
<url-pattern>/VelocityTest</url-pattern>
</servlet-mapping>
</web-app>
I have state in the servlet class tag: com.velocity.velocityObj.velocityTest.
Previously when the class file is in the WEB-INF/classes directory, my servlet tag is this: <servlet-class>velocityTest</servlet-class>
What can i edit to the tag to read the class file:?
This is my error:
Code:
11:37:28,753 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.2.2.GA/server/default/deploy/velocity.war/
java.lang.NoClassDefFoundError: com/velocity/velocityObj/velocityTest (wrong name: velocityTest)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
Thanks i n advance