ProAnswers.org

How to make a context thread safe?

Synchronizing the ServletContext is the only solution to make a ServletContext thread safe.

Eg: synchronized (getServletContext ())

{

  // do whatever you want with thread safe context.

}