Use the sendRedirect, see below:
response.sendRedirect("http://localhost:8080/? /ServletName ");
----- Original Message -----
From: Servlet Java <[EMAIL PROTECTED]>
Date: Thursday, October 19, 2000 4:05 pm
Subject: Call a servlet from another servlet
> Dear All,
>
> I use jsdk 2.1 and can run the downloaded examples.
>
> I have problem to call a servlet from another servlet but no
> problem to call
> an HTML page at same location.
>
> Could anyone give me some help please?
>
> Best Regards.
>
>
> First servlet is at
> D:\jsdk2.1\webpages\WEB-INF\servlets
> the second servlet and HTML file are at:
> D:\jsdk2.1\webpages\myservlets
>
> Please see the source code below:
>
> public class Hello extends HttpServlet {
>
> public void doGet(HttpServletRequest request,
> HttpServletResponse response)
> throws IOException, ServletException
> {
> response.setContentType("text/html");
> PrintWriter out = response.getWriter();
>
> out.println("<html>");
> out.println("<body bgcolor=\"white\">");
> out.println("<head>");
>
>
> out.println("<title> Hello Title </title>");
> out.println("</head>");
> out.println("<body>");
> out.println("<h2> Hello body /h2>");
>
> //
> // Problems here
> //
> out.println("<p>");
> out.println("Execute:
> This one does not work");
> out.println("</p>");
>
> //
> // No Problems here
> //
> out.println("<p>");
> out.println("");
> out.println("link to helloworld html page: This one work");
> out.println("</p>");
>
> out.println("</body>");
> out.println("</html>");
> }
> }
>
>
>
>
>
________________________________________________________________________
_
> Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com.
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>
________________________________________________________________________
___
> To unsubscribe, send email to [EMAIL PROTECTED] and include in
> the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http:
> Resources: http://java.sun.com/products/servlet/external-
> resources.htmlLISTSERV 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