HTML links from a servlet to an applet
File ServletToApplet.java
The program creates a web page with the link to the applet McKoiApplet.class on
puma.
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ServletToApplet 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> From servlet to applet </title>");
out.println("</head>");
out.println("<body>");
out.println("<h2>This servlet has a link to an applet</h2>");
out.println("Click <A HREF=\"http://cs.wellesley.edu/~ecom/download/AppletExample.html\">");
out.println(" here</A> to see the applet");
out.println("</body>");
out.println("</html>");
out.close();
}
}
This page has been created and is maintained by Elena Machkasova
Comments and suggestions are welcome at emachkas@wellesley.edu
Spring Semester 2002