import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class Loaded extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/plain"); PrintWriter out = res.getWriter(); ServletContext context = getServletContext(); Enumeration names = context.getServletNames(); while (names.hasMoreElements()) { String name = (String)names.nextElement(); Servlet servlet = context.getServlet(name); out.println("Servlet name: " + name); out.println("Servlet class: " + servlet.getClass().getName()); out.println("Servlet info: " + servlet.getServletInfo()); out.println(); } } }