Chapter 7. Thread-Safe Servlets

Terms you'll need to understand:

  • Threads

  • Multithreads and single threads

  • Thread-safe attribute scopes

  • SingleThreadModel

Techniques you'll need to master:

  • Identify which attribute scopes are thread-safe.

  • Understand the differences between the multithreaded and single-threaded servlet models.

  • Identify the interface used to declare that a servlet must use the single-threaded model.

This chapter provides an explanation of servlet threads and servlets that are considered thread-safe.

Servlet Threads

A thread is a single execution process, a single sequential flow of control within a given program. The container runs several threads at once. The way the server works begins with at least one thread listening to the port for HTTP ...

Get Java™ 2 Enterprise Edition (J2EE™) Web Component Developer Exam Cram™ 2 (Exam 310-080) now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.