As per New Servlet Specs. getServletNames() method has been deprecated due
to crashing of the Servlet Engines. & thus it returns null as temporary
solution & will be phased out soon.
bye,
Jiger
>From: Usha <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Loaded Servlets Problem
>Date: Mon, 5 Jun 2000 17:53:14 +0530
>
>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
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
___________________________________________________________________________
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