Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run an applet from a servlet

Status
Not open for further replies.

thanhvinhnguyen

Programmer
Jun 17, 2001
3
CA
Hi,

Can somebody give me a code example of how to run an applet from a servlet ?This code does not work :I get ubeApplet.class not found

import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Cube extends javax.servlet.http.HttpServlet {

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws javax.servlet.ServletException, java.io.IOException {

response.setContentType("text/html");
PrintWriter out = response.getWriter();

out.println(&quot;<HTML>&quot;);
out.println(&quot;<HEAD>&quot;);

out.println(&quot;<TITLE>Rubik cube</TITLE>&quot;);
out.println(&quot;</HEAD>&quot;);
out.println(&quot;<BODY>&quot;);
out.println(&quot;<H1>First Heading</H1>&quot;);
out.println(&quot;<HR>&quot;);
out.println(&quot;<APPLET CODE=CubeApplet.class WIDTH=700 HEIGHT=500></APPLET>&quot;);
out.println(&quot;<HR>&quot;);
out.println(&quot;</BODY>&quot;);
out.println(&quot;</HTML>&quot;);


}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws javax.servlet.ServletException, java.io.IOException {

doGet(request, response);
}

}


 
Can you just tell me more what are you using to run your servlets and applets.
Are you using servletrunner or a jws ?
Where do you keep the class files of both applet and servlet ?

in detail.....

thanks
vikas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top