Big applet

O

Ouabaine

Hello,

I am developping a big applet (hundreds of classes) from an existing
java application project, with Netbeans. And there are points I do not
understand. Sorry if my questions are at a beginner level, but I cant find
the answer in any of my books or on the internet.
I have my Netbeans project for the applet. It creates a file name
myproject.war in the dist folder of the project. (war as Web ARchive?)
Question 1: is the war file the one to put on the server. If yes, what
code do I insert in the html Applet tag, as (from what I read in my books)
you have to make the "code" tag point to a .class file.
Question 2: the war file is very big, as it contains several
libraries, like "common-beanutils.jar" etc. Why are these libraries there?
Are they needed? Can I remove them?

I know that I could use Java web start to launch my application, and
will certainly do a JWS version of it. But I also need the application to be
neatly inserted into a web page.

Thanks in advance for you help.

Francois
 
T

TwelveEighty

It creates a file name
myproject.war in the dist folder of the project. (war as Web ARchive?)
Question 1: is the war file the one to put on the server. If yes, what
code do I insert in the html Applet tag, as (from what I read in my books)
you have to make the "code" tag point to a .class file.

I haven't build applets in ages, but I am guessing you created a Web
application in Netbeans, which creates a WAR archive, rather than a
JAR archive. Unless you plan to use JSP, Web services or J2EE, I would
instead create a simple Class Library in Netbeans and put your applet
classes in there.

Question 2: the war file is very big, as it contains several
libraries, like "common-beanutils.jar" etc. Why are these libraries there?
Are they needed? Can I remove them?

This is a side-effect of creating a Web Application; Netbeans will
automatically add certain Libraries to your project for this type of
application.

Once you have the .JAR file, you can use the applet tags to set the
codebase to point to the archive. Make sure the archive is accessible
through the web server. Which web server are you using?
 
M

Mark Space

Ouabaine said:
Question 1: is the war file the one to put on the server. If yes, what
code do I insert in the html Applet tag, as (from what I read in my books)
you have to make the "code" tag point to a .class file.

WAR files are for Web Apps. These are not Applets Those are two totally
different things.

To deploy a web ap (WAR file), you need a CGI that reads them. Tomcat
and JBoss are two examples of such Java CGI. Normally you need Apache too.

(And it's not CGI at all, really, but that's the easiest explanation I
can think of without getting too much into details.)

To answer your question directly: no, you can't put a .war file inside
applet tags, it'll not work at all.
Question 2: the war file is very big, as it contains several
libraries, like "common-beanutils.jar" etc. Why are these libraries there?
Are they needed? Can I remove them?

Java Beans is a J2EE thingy, which is what you are building with the
..war file. Try here:

http://java.sun.com/javaee/5/docs/tutorial/doc/index.html


First, you should verify whether you or your customer wants an Applet,
or Web App (.war). They are very different. Then proceed from that point.
 
L

Lew

Mark said:
Java Beans is a J2EE thingy, which is what you are building with the
..war file. Try here:

JavaBeans are a core Java thingy. *Enterprise* JavaBeans (EJBs) are a Java EE
thingy.
 
R

Roedy Green

I am developping a big applet (hundreds of classes) from an existing
java application project, with Netbeans. And there are points I do not
understand. Sorry if my questions are at a beginner level, but I cant find
the answer in any of my books or on the internet.
I have my Netbeans project for the applet. It creates a file name
myproject.war in the dist folder of the project. (war as Web ARchive?)
Question 1: is the war file the one to put on the server. If yes, what
code do I insert in the html Applet tag, as (from what I read in my books)
you have to make the "code" tag point to a .class file.
Question 2: the war file is very big, as it contains several
libraries, like "common-beanutils.jar" etc. Why are these libraries there?
Are they needed? Can I remove them?

I know that I could use Java web start to launch my application, and
will certainly do a JWS version of it. But I also need the application to be
neatly inserted into a web page.

Any big project will be much easier with JAWS than an Applet. see
http://mindprod.com/jgloss/javawebstart.html Dealing with aux
libraries or JNI is a major pain with Applets.

Applets use plain jars, usually signed for big projects, not war
files. War files are for Servlets.

You can use a fancy graphic to act as a button to launch the JAWS app.
See http://mindprod.com/webstart/setclock.html

see http://mindprod.com/jgloss/applet.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top