A servlet is a program that runs in a servlet container, like Tomcat. Think of it as a dynamic web page. When the container gets an HTTP request for the servlet 'web page', it invokes the servlet. The servlet 'prints' the web page, and the container sends it back to the browser. The browser just receives some HTML as normal, so the servlet appears to be the same as a static web page.
But obviously, the servlet can be as complicated as you want, and can even build the response based on a database query.
Applets are client side programs that are downloaded from the server before being executed. They are (usually) subject to a number of limitations on what they can do, for security reasons.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.