It may be that getServlet has been deprciated for a
long time. Since servlet spec 1.0 I believe.
--- Debashis Das <[EMAIL PROTECTED]> wrote:
> 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
=====
------------------------------------------------------------
James Wilson
HealthFirst Corporation
[EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.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