Jsp - Applet - Tomcat
Jeg har en jsp side, og en applet jeg gerne vil have til at snakke sammen, med hver gang får jeg en ClassNotFoundException.... Hvorfor det...?TextInJApplet.java
import javax.swing.*;
import java.awt.*;
public class TextInJApplet extends JApplet
{
private int size;
private String text;
private JTextField tf;
public void init()
{
String sizeStr = getParameter("size");
if(sizeStr!=null)
{
size = Integer.parseInt(sizeStr);
}
else
{
size = 8;
}
text = getParameter("text");
if(text==null)
{
text = "nothing was sent !";
}
tf = new JTextField(text);
tf.setFont(new Font("courier",Font.BOLD,size));
getContentPane().setLayout(new FlowLayout());
getContentPane().add(tf);
}
}
<%@ page language="java" %>
ShowAnApplet.jsp:
<HTML>
<HEAD>
<TITLE>jspIncludeToShowAnApplet.jsp</TITLE>
</HEAD>
<BODY>
<P><h1>jspIncludeToShowAnApplet.jsp</h1></P>
<h2> The following is a JApplet invoked using jsp:include </h2>
<jsp:plugin type="applet" code="TextInJApplet.class" jreversion="1.3" align="center" width="400" height="300" nspluginurl="http://java.sun.com/products/plugin/1.3.0_01/plugin-install.html" iepluginurl="http://java.sun.com/products/plugin/1.3.0_01/jinstall-130_01-win32.cab#Version=1,3,0,1" >
<jsp:params>
<jsp:param name="text" value="JAVA WINS ALL :)"/>
<jsp:param name="size" value="12"/>
</jsp:params>
</jsp:plugin>
<h4>isn't it lovely ... :)</h4>
</BODY>
<HTML>
