The applets interact with the servlets, which interact with the database server and the Web server using the native API of the Web server. Of course, you can mix and match all of the architectures I just mentioned to create your own exciting combination of enabling technology that is even more complex than the ones I list. For instance, I've seen a number of projects using servlets to link to both TP monitors and distributed objects at the same time, as well as Java applets linking directly to legacy applications. This whole concept is a tradeoff. It's disturbing to see developers move away from the standards that made the Internet great, but they are doing so to get around many of the limitations that traditional Web technology places upon them.
History always seems to repeat itself.
With the advent of IIOP, distributed objects can even run on the browser, the Web server, the application server, or the database server.