Hi friends

I am trying to get the list of servlets tht are loaded by the Web server (
Java Web Server )
According to me the servlet which is running should be there in the list of
loaded servlets. But when i try to get tht servlet in get a null. Is there
something tht i am missing out. I have attached my code below

Thanks in advance

Regards
Usha.


import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class ShowNameServlet extends HttpServlet{
        public void doGet(HttpServletRequest req, HttpServletResponse res) throws
IOException, ServletException
        {
                res.setContentType("text/html");
                PrintWriter out = res.getWriter();
                out.println("<html>Hello");

                Enumeration e = getServletContext().getServletNames();
                Servlet s = getServletContext().getServlet("LoadedServlets");
                out.println("Servlet Name = " + s);
                while(e.hasMoreElements())
                {
                        out.println("HI");
                        out.println((String)e.nextElement());
                }
                out.println("</html>");
        }
}
------------------------------------------------------------------------
---------------------------
A Champion is not one who never fails, but one who NEVER QUITS !

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to