Is it good idea to create servlet constructor?

Yes, Servlet can have Constructor, it's perfectly legal but it's not the right way to initialize your Servlet. You should use the init() method provided by the Servlet interface to initialize the Servlet.

Related posts: