«
^
»
3.2. What is a servlet and how is it executed?
A servlet is a WWW page that is written in Java.
When a browser accesses the URL of a servlet, the webserver program arranges for the bytecodes of the servlet to be executed.
Of course, you need to be using a webserver program that can execute bytecodes.
One possibility is to use tomcat, a webserver program from the Apache Software Foundation.
The code of the servlet does some work and then generates some HTML.
The webserver program gets the HTML and passes that to the visitor's browser.