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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.