I was going through one of the examples in the SCWCD Exam Study Kit by Hanumant Deshmukh and Jignesh Malavia. The example is on p268.
...
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
...
synchronized (request)
{
...
}
}
I don't understand when you would ever need to synchronize on request? The request variable is a local variable. Unless you are passing the request variable explicitly to another
thread I don't see why this would be done?