No, I'm not going to add the near-requisite "oh my." (I know you were expecting it -- don't deny it!)
I'm writing this because I spent far too long trying to figure out what applets, servlets, and Java are. Well, not Java. I knew what that was.
So that makes an easy starting place:
WHAT IS JAVA?
Java is a programming language. The biggest thing that makes it different from any other, really, is that Sun (the creators of Java) have put a great deal of effort into making Java as universal as possible. That means a program written in Java can run on just about any computer in the world.
WHY DO I THINK JAVA IS COOL?
First, it's really easy to find tutorials and sample code and discussions about how to do specific, weird things with Java. That may also be true of other languages -- I don't know, because I've never looked.
Second, Java has lots of great functions that make it easy to do web stuff. I wanted to write a program that would search the web for me -- went from knowing absolutely no Java to having a working program in a couple days. When I needed to access the web through a cascading series of proxies, the functions were there. It was the simplest thing in the world.
Third, Java is free, and so is just about everything associated with it. "Eclipse" is a great tool to help write Java code, by the way.
WHAT ARE APPLETS?
No, they're not little apples.
Java Applets are Java programs that are designed to run inside web browsers. Basically, if you write an applet, people can browse to your web page and -- bingo! They're running your program, right in their browser. They might not even realize they're running a special program.
To convert a regular Java application into an Applet just requires you to change the main class to extend the Applet class, and rename your main() to init(). Basically. Then you have to debug all the other little things that break when you do that. But if you start there, Eclipse will walk you through the rest.
WHY ARE APPLETS COOL?
Applets are better than static HTML because the user interface is so powerful. They are faster than dynamic HTML because users just download the whole Java program at once, then it runs on their local machines. They don't have to download every new screen every step of the way.
I am using a Java Applet as the front-end user interface for a complex system I'm putting together.
WHAT ARE SERVLETS?
Servlets are Java programs that are designed to respond to web pages or applets. They run on the server, as opposed to applets (which, as I said, run on the client -- the end user's computer). As such, they are invisible to the users. Users should probably never need to know (or at least think much about) the servlets.
WHY ARE SERVLETS COOL?
Here's the groovy thing. Applets have a tiny drawback -- they can't read or write data on the user's hard drive. Part of the Java 'sandbox' that keeps us safe. (Because wouldn't it make you mad if a site you visited loaded up an applet that played a pretty song at you while it reformatted your hard drive?)
Since servlets run on the server, though, they can write to the server and do all sorts of other cool things in the background. If you have a program that takes some time to run -- for instance, a bulk email program (which is NOT what I'm working on!) -- an applet can start the servlet and then let the user get on with his browsing.
If you were running the long program in the applet, the user would have to sit there until the whole thing finished. If the window were accidentally closed (or if you clicked on a link from an email and it automatically moved your browser to the new page) you'd lose everything. Kind of a bummer.
HOW FUN!
Yes. I just figured out the last part (about servlets) today. I am excited to write my servlet piece and see if it really works. I suppose I'll let you know how it goes.
THE END?
It sure is.