thanhvinhnguyen
Programmer
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("<HTML>"
out.println("<HEAD>"
out.println("<TITLE>Rubik cube</TITLE>"
out.println("</HEAD>"
out.println("<BODY>"
out.println("<H1>First Heading</H1>"
out.println("<HR>"
out.println("<APPLET CODE=CubeApplet.class WIDTH=700 HEIGHT=500></APPLET>"
out.println("<HR>"
out.println("</BODY>"
out.println("</HTML>"
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws javax.servlet.ServletException, java.io.IOException {
doGet(request, response);
}
}
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("<HTML>"
out.println("<HEAD>"
out.println("<TITLE>Rubik cube</TITLE>"
out.println("</HEAD>"
out.println("<BODY>"
out.println("<H1>First Heading</H1>"
out.println("<HR>"
out.println("<APPLET CODE=CubeApplet.class WIDTH=700 HEIGHT=500></APPLET>"
out.println("<HR>"
out.println("</BODY>"
out.println("</HTML>"
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws javax.servlet.ServletException, java.io.IOException {
doGet(request, response);
}
}