You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ja...@spunkysoftware.com on 2001/09/05 14:40:04 UTC

How to write a Tomcat app?

Hi, me again. I still don't know how to write an app.

I tried compiling an app, but the javac compiler complained it couldn't find
javax.servlet classes or whatever the hell they were. So I need to do
something with my CLASSPATH right? What? One servlet tutorial mentions
servlet.jar and jsp.jar that come with the JSWDK, what are these equivalents
on Tomcat?

Also, what is the difference between a Bean and a Servlet? It seems that
Beans hide some functionality like just algorithms for some purpose like a
shopping cart and storing data, but not generating output. Whereas a servlet
seems to handle get and post and generates HTML pages or whatever.

What are the steps to writing an app, from start to finish (app.war)?

1. Write JSPs, Servlets and Beans.
2. How do I complie servlets and Beans, anything special for the classpath?
3. Directory structure. I read in the Tomcat docs that I need a directory in
the /webapps file, say /webapps/shopfront. Then I edit server.xml and add a
context, so anything there can be fetched from the context path in the
browser, I think I've got that.
4. The web-inf directory and stuff. What do I need to put in these
directories?
5. Shit, I don't know. Why is the Tomcat documentation so vague and hard to
follow? Why can't it be written for dumbos like me???

How do I put some automation into my app creation process? Anybody got any
tips for a batch file that will take a parameter like a directory name and
make a context directory and get everything ready?

Thanks heaps. I know this must be annoying.

James Buchanan
Idiot Extraordinaire


Re: How to write a Tomcat app?

Posted by Pier Fumagalli <pi...@betaversion.org>.
"james@spunkysoftware.com" <ja...@spunkysoftware.com> wrote:

> Hi, me again. I still don't know how to write an app.

I suggest Jason Hunter's "Servlet Programming, 4th Edition" from O'Reilly.
It includes examples on how to deploy servlets and web apps under Tomcat.

    Pier