posted 11 years ago
There's nothing wrong with using synchronized blocks, provided they're not applied to the entire code flow. Be aware that other approaches to writing thread-safe code are available that may be better suited.
Also note that there's nothing wrong with instance variables in servlets, provided that they're not mutable, or that access to them is synchronized.