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("<a href=\"../myservlet/HelloWorldExample\">Execute:
This one does not work</a>");
        out.println("</p>");

       //
       // No Problems here
       //
        out.println("<p>");
        out.println("<a href=\"../myservlets/helloworld.html\">");
        out.println("link to helloworld html page: This one work</a>");
        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://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