Servlet is multithread by default

To start, see this link to get the basic concepts of servlets.

By default, the servelt is of multi-threaded design, so be careful when using class fields since the servlet is not thread safe. The was SingleThreadModel implementation in Java, but now it is deprecated since it does not solve the multi-thread issue overall. It is better to use local variables on servlets and call the classes on the servlet methods.

See the link here on Class fields and local variables explained.

Some links on the servlet multi-thread issue.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s