Loading an applet from a servlet [message #166743] |
Tue, 22 August 2006 14:35  |
Eclipse User |
|
|
|
Originally posted by: anthonymacegan.yahoo.ie
I am using Eclipse with Tomcat as my server.
I have been using servlets to generate html and all is working well.
I now want to call an applet within the servlet.
I am not having much success and am reading a lot of stuff on various
sites but I can find no definate information.
I create the applet like any other class and when I have it saved I choose
to run it as an applet and it works fine. It is stored in the same folder
as the other classes.
jakarta-tomcat-5.5.7\ProjectX\WEB-INF\classes
So when I call it within the applet tags what should I specify as the
CODEBASE?
Do I have to create a web.xml file and do some mapping of sorts?
Do I save the class in a different folder.
The applet is a simple one I am using as an initial test.
import java.awt.*;
import java.applet.Applet;
public class CounterApplet extends Applet
{
Button button1, button2, button3, button4, button5;
public void init()
{
this.setLayout(new BorderLayout());
button1 = new Button("Button 1");
button2 = new Button("Button 2");
button3 = new Button("Button 3");
button4 = new Button("Button 4");
button5 = new Button("Button 5");
add("North",button1);
add("South",button2);
add("East",button3);
add("West",button4);
add("Center",button5);
}
}
Any help would be greatly appreciated.
Best regards,
Anthony.
|
|
|
|
Re: Loading an applet from a servlet [message #166936 is a reply to message #166920] |
Wed, 23 August 2006 17:03  |
Eclipse User |
|
|
|
Originally posted by: anthonymacegan.yahoo.ie
Thanks Eric.
I will try this approach.
Could you give me an idea as to how I make the jar files publically
available from the server (running on my own machine)
Ths is a bit of a new field for me but I am really hungry for any new
knowledge.
Thanks for your help so far.
Anthony.
|
|
|
Powered by
FUDForum. Page generated in 0.32836 seconds