J2EE provides not one but two technologies for creating dynamic Web page content: servlets and Java Server Pages (JSP). Historically, Java servlets came first and in fact JSP is built on top of servlet technologies. It is useful (but not entirely necessary) to know Java servlets before discussing JSP, so we will start our discussion there.
Both JSPs and servlets operate over networks, so in order to really understand how to write a Web application, you need to understand networking and HTTP. Once we have developed an understanding of the networking foundation of servlets, we focus our discussion on servlets, and explain the technology using several examples.