logo       

Apache Tomcat/4.1.24 forumdemo/servlet_example1 not working: msg#00090

jakarta.velocity.user

Subject: Apache Tomcat/4.1.24 forumdemo/servlet_example1 not working

this example from the developers doc's does not work nor does the forumdemo war file. Can someone help me understand what needs to be configured re Velocity, or Tomcat to get these examples in a working state?

Thanks,
reid

Setting up under Jakarta Tomcat <http://jakarta.apache.org/tomcat/> is fairly straightforward. The 'webapp' directory is where Tomcat automatically looks for it's 'web applications', so this is where we will set things up.

1. First, make a new 'webapp' by creating a directory called
/velexample/ in Tomcat's webapps directory, and make a new
directory structure as follows :

velexample
velexample/WEB-INF
velexample/WEB-INF/lib
velexample/WEB-INF/classes

2. Put the Velocity jar into the velexample/WEB-INF/lib directory.
Note that with v1.2 and newer, you either have to either use the
jar from the distribution (or that you build yourself) that
contains all the dependencies ( ex. velocity-dep-1.2.jar) or you
must add the dependency jars yourself to the WEB-INF/lib
directory. Please see the section "Getting Started" and
"Dependencies", above.
3. Put the SampleServlet.class into the velexample/WEB-INF/classes
directory
4. Put the sample.vm template into the velexample directory. The
SampleServlet is written to use the root of the webapp as the
source of the templates, so no configuration is needed.
5. At this point, you should be able to start (or restart) Tomcat and
access the servlet.
6. To access the servlet, point your web browser at :

http://localhost:8080/velexample/servlet/SampleServlet
or if that doesn't work :

http://<your computer's ip
address>:8080/velexample/servlet/SampleServlet
7. You should see the sample output.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise