getServletNames <../../javax/servlet/ServletContext.html> ()

Deprecated. As of Java Servlet API 2.1, with no replacement.
This method was originally defined to return an Enumeration of all the
servlet names known to this context. In this version, this method always
returns an empty Enumeration and remains only to preserve binary
compatibility. This method will be permanently removed in a future version
of the Java Servlet API.


To communicate among servlets, it is recommended to use include() and
forward()  of Request dispatcher

Tushar
        ----------
        From:  Debashis Das [SMTP:[EMAIL PROTECTED]]
        Sent:  May 26, 2000 11:34 PM
        To:  [EMAIL PROTECTED]
        Subject:  Problem in Servlet Chaining..

        I was going thru the InterServlet Communication chapter of the book
by
        J.Hunter. I simply copied the following code from his book. But it
does
        n't works. I am using Java Webser Server.

        CAn anyone help me in solving the problem.. Following is the code..


        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();
            }
          }
        }
        --
        Debashis Das
        Tata Consultancy Services
        Phone Nos.: Office:(303) 896-8548, Home: (720) 941-9057


___________________________________________________________________________
        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

___________________________________________________________________________
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