TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG-DEVEL:44] tomcat



Erick Stohr wrote:
> 
> I did do a control-c but did a /opt/tomcat/shutdown.sh to stop the processes.

Did it do a true shutdown? By this I mean you saw Tomcat WebServer
Version 2.2 - shutdown in the terminal window as the last line before
you did a Ctrl-C?

> I am using localhost:8080 and I do get the tomcat homepage.  Also, if you
> have any quick info on how to serve servlets that would not take too much of
> your time I would appreciate it, I found something inthe FAQ and am just
> starting to look at it. Thanks.
> 

Under /opt/tomcat create the following directory structure:

mystuff
--> WEB-INF
----> classes

Put your servlets in the mystuff/WEB-INF/classes directory.

Edit the server.xml file found in /opt/tomcat. Copy the "examples" block
within the file and replace "examples" with "mystuff"

You should be able to run your servlet by typing
http://localhost:8080/mystuff/servlet/Foo

If not, do the following:

Copy the web.xml file found in examples/WEB-INF and place it in
mystuff/WEB-INF

Edit it so that it looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
    <servlet>
      <servlet-name>
          Foo
      </servlet-name>
      <servlet-class>
          com.eric.servlet.FooServlet
      </servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>
            Foo
        </servlet-name>
        <url-pattern>
            /Foo
        </url-pattern>
    </servlet-mapping>
</web-app>

Now type http://localhost:8080/Foo and it should work.

-- 
Perry Hoekstra
Consultant
Talent Software Services
dutchman@mn.uswest.net	
(612) 253-8461