Hi James,
Servlet Container actually allows you to emulate Stateless SB behaviour:
you should implement SingleThreadModel interface in your servlet or
JSP (isThreadSafe="false").
In this case Servlet Container either will create pool of servlet instances or will serialize request and put in queue to 1 servlet instance (Servlet specification does not mandate which approach should be implemented). What is guaranteed: only 1 request will be served by 1 instance of servlet at 1 moment of time.
But, just FYI - this practice considered bad, and SingleThreadModel interface is *deprecated* (AFAIR) in Servlet 2.4 API.
When only 1 instance of any servlet exists that saves much memory.
And, yes, as you mentioned - you should be careful about thread-safety while developing web application. That's why the exam tests knowledge of thread-safety of attributes/variables in different scopes.
regards,
MZ