Yes, that is exactly the reason. It will return null. The requestDispatcher
interface is the
suggested approach for servlet to servlet chaining.
At 09:12 AM 05/27/2000 -0700, James Wilson wrote:
>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
>
Rajesh Nair
[EMAIL PROTECTED]
Ph: 913 599 7201
----------
R&D
Informix Software
___________________________________________________________________________
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