Title: RE: Applet Servlet Communication

hi see to it that both applet and servlet are in classpath and teel me which server are you using?

    ----------
    From:   PANKIL R. SHAH[SMTP:[EMAIL PROTECTED]]
    Reply To:       A mailing list for discussion about Sun Microsystem's Java Servlet API Technology.
    Sent:   Sunday, March 26, 2000 3:27 AM
    To:     [EMAIL PROTECTED]
    Subject:        Applet Servlet Communication

    Hi,

    I got a problem. I have an applet and I want to communicate with the
    database. The connection of the database is the run() method of the
    applet. I have embedded the applet within the servlet. i.e the servlet
    code looks like :

    public class Test1 extends HttpServlet
    {
            public void doGet( HttpServletRequest request,
                    HttpServletResponse response )
                    throws ServletException, IOException
            {
                    PrintWriter output;
                    response.setContentType("text/html");
                    output=response.getWriter();

                    StringBuffer buf = new StringBuffer();
                    buf.append("<HTML>\n");
                    buf.append("<applet code=PlayBack.class height = 500
    width = 500>\n");
                    buf.append("</applet>\n");
                    buf.append("</HTML>\n");
                    output.println(buf.toString());
                    output.close();
            }
          public void doPost( HttpServletRequest request,
                    HttpServletResponse response )
                    throws ServletException, IOException
            {
             doGet(request,response);
          }

    }

    where PlayBack.java is the applet. Still I am having problem with the
    servlet connecting with the database. Anybody got a solution to this.
    Thanks for any help.

    Regards,
    Pankil.

    ___________________________________________________________________________
    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