Hi there ...in my application there is an applet that communicates with
a servlet to get information from a database ...After getting this
information ...the applet sends back information to the servlet which
the servlet uses to set data in the database ...


Now ...the servlet (extends HttpServlet) sends info  to the applet thru
the doGet method and receives information from doPost method ...Now I
was wondering whenther I could create a HTML with the applet embedded in
it in the servlet class .

I got a html page to appear using the service method of Servlet API .Now
I am having trouble getting the applet to appear on the html file. I
have heard that this is a common problem of directing the applet path.I
have tried a lot of combinations ..and I have even tried typing in the
whole path ...

Here are my questions
1) Is putting the creation of the html in the service method the correct
way to do it ?
    I cannot think of any other way to do it .
2) Here is my code ...What prevents the applet from loading ???

public void service(ServletRequest req,
                              ServletResponse res)
              throws ServletException, IOException {
              // Process a customer's order
                            // Thank the customer for the order
              res.setContentType("text/html");
              //PrintWriter out = res.getWriter();
              PrintWriter out   = res.getWriter();
          System.out.println("About to create a html page");
         // The following println statements create an HTML page.
         out.println( "<html>" );
         out.println( "<head><title>PACS Database</title></head>" );
         out.println("<applet
code=D:\\Java_Stuff\\jsdk2.1\\examples\\WEB-INF\\servlets\\MainApplet.class></applet>");

         out.println( "<body>" );
         out.println( "<h1>PACS Database</h1>" );
         out.println( "<p>As of howdy doody");
         out.println(" there are ");

         out.println(" studies in PACS and ");


         out.println(" images.");
         out.println( "</body>" );
         out.println( "</html>" );
         out.close();
          }

___________________________________________________________________________
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