Google
 

 

up previous next contents
Up: 3. Day 3: Standard Previous: 3.10 HTTP protocol Next: 3.12 Servlets   Contents

Subsections

3.11 Servlets and JSPs

3.11.1 Objectives

  • Describe the JSP dynamic HTML model.
  • Write JSPs to generate dynamic HTML.
  • Include Java code in JSPs.
  • Understand and use implicit objects in JSPs.

3.11.2 Introduction/Background

  • Original HTML content on the web was largely static HTML pages.
  • CGI scripts were the first way of generating HTML pages with dynamic content.
  • Servlets are Java programs that run within a web server, or within a web application server.
    • There is a special Servlet API.
    • Servlets work hand-in-hand with databases, JavaBeans, components, and JSPs.
  • JSPs are a combination of HTML and Java code.
  • JSPs are a form of servlets; that is, they are compiled into servlets behind the scenes. In practice however, they appear quite different, and appear like a combination of HTML and Java code.
  • In practice, JSPs should be approximately 90% HTML code and 10% Java code.