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.