package examples.htmlkona; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import weblogic.html.*; /** * Demonstrates how to load an applet from a servlet. * * @author Copyright (c) 1996-98 by WebLogic, Inc. All Rights Reserved. * @author Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved. */ public class AppletLoader extends HttpServlet { public synchronized void service(HttpServletRequest req, HttpServletResponse res) throws IOException { try { res.setStatus(HttpServletResponse.SC_OK); res.setContentType("text/html"); ServletPage hp = new ServletPage("Applet Loader"); AppletElement applet = new AppletElement("Blink.class", 300, 100, AlignType.center); applet.setCodeBase("http://www.weblogic.com/applets/classes/") .addElement(new ParamElement("lbl ", "This is the next best thing to sliced bread! " + "Toast, toast, toast, butter, jam, toast, " + "marmite, toast.")) .addElement(new ParamElement("speed", "4")); hp.getBodyElement() .setAttribute(BodyElement.bgColor, HtmlColor.white); hp.getBody() .addElement(new HeadingElement("This is the Blinking Text Applet from Sun")) .addElement(applet) .addElement(MarkupElement.HorizontalRule); hp.output(res.getOutputStream()); } catch (Exception e) { defaults.showException(e, res.getOutputStream()); } } }