while i can’t really think of a practical use-case for such a scenario, but i purely intend this to be a curiosity driven question.
i understand the servlet container holds onto all the instances created of the servlets, and delegates request threads to these instances. it also makes sense to keep these instances managed, to avoid unwarranted calls to alter the lifecycle of servlet instances outside the purview of the container.
but is there really no way to access the servlet instances?
Prior to Servlet 2.1 (over a decade old already), you could use
ServletContext#getServlet()for this. It’s however deprecated since then. Simply because it’s a bad design. If you want to invoke another servlet from inside a servlet in the request-response chain, just useRequestDispatcher#include(). If you want to invoke non-servlet specific methods of another servlet, then it’s simply high time to refactor that code into a separate Java class which you could then import/use in the both servlets.