The init method in most (all) of my servlets is similar. Mostly initializing a DataSource
I am thinking of creating a BaseServlet having a protected DataSource and the init method implemented and all other servlets extend this BaseServlet.
Any Gotchas I should be wary of?
In the current approach:
BaseServletwill create its own datasource as theinit()method will be called multiple times.Assuming above is true, I would suggest following