velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike D'Ambrogia" <>
Subject Newb: SampleServlet Example not working
Date Mon, 01 Aug 2005 22:40:45 GMT

New/inexperienced in Tomcat 5.0.28 but getting there slowly, currently
reading the tomcat tutorial.  I've searched the V-U archives on without luck.  Trying to get the simpleservlet
example up and running without luck.  I've gone overboard with info here
in the hopes that the configuration mistake I'm making will be readily
apparent to someone.

TC located in C:\apache\tomcat\ on Win2kpro system,
JAVA_HOME=j2sdk1.4.2_04 but also have jdk1.5.0_04 on the system too

Per the instructions in
velocity-1.4\examples\servlet_example1\readme.txt I've done the

 - made a new directory structure as follows :

 - put the velocity.jar into the velexample/WEB-INF/lib directory (it
came named as velocity-1.4.jar, have not renamed)
 - put the SampleServlet.class into the velexample/WEB-INF/classes

 - put the sample.vm template into the velexample directory.

 - restart tomcat and access the servlet at

I've done nothing else to TC other than stop/start it.  on restart the
console output shows this:

Aug 1, 2005 3:18:18 PM org.apache.catalina.core.StandardHostDeployer
INFO: Installing web application at context path /velexample from URL
Aug 1, 2005 3:18:18 PM org.apache.catalina.startup.ContextConfig
INFO: Missing application web.xml, using defaults only
Aug 1, 2005 3:18:18 PM org.apache.catalina.core.StandardHost start

after restart I go to the url above and get this:

HTTP Status 404 - /velexample/servlet/SampleServlet
type Status report
message /velexample/servlet/SampleServlet
description The requested resource (/velexample/servlet/SampleServlet)
is not available.

If I go to I get a dir listing

If I click on the sample.vm file in the listing I get the actual
contents of the .vm file without the velocity substitutions for $name,
$list, etc displayed which is probably correct given that I'm not
running thru the servlet.

Notes towards the bottom of \velocity-1.4\docs\developer-guide.html make
reference to changes that need to be made to the web.xml file, adding:


Is this chg to web.xml required to run this example code??  Info is abit
thin (for me at least) on what the values for servlet-name and
servlet-class should be, looking for some help with these.  If this chg
is necessary can I add it to a web.xml file in

All help appreciated, looking fwd to coming up to speed


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message