?
Solved

Newbie : Applet question

Posted on 2003-03-22
9
Medium Priority
?
284 Views
Last Modified: 2013-11-24
I have a applet class and archieve into a JAR file. I found that the JAR file MUST be placed in the same directory as the HTML file. Like this.

<APPLET CODE="test.class" ARCHIVE="test.jar"     WIDTH=anInt HEIGHT=anInt></APPLET>

If I want to place the JAR file in another directory, says WEB-INF/classes, I always failed.
This will fail

<APPLET CODE="test.class" ARCHIVE="WEB-INF/classes/test.jar"     WIDTH=anInt HEIGHT=anInt></APPLET>

This will also fail

<APPLET CODE="test.class" ARCHIVE="test.jar" CODEBASE="WEB-INF/classes"     WIDTH=anInt HEIGHT=anInt></APPLET>

I have no problem if I use classes file and access it from another directory. The problem is only accessing JAR file from another directory.
Is this a limitation of browser or JAVA?? Please help.
0
Comment
Question by:zerg2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 8189963
 Have you tried changing the classpath to include the jar file in the directory you want?
0
 

Author Comment

by:zerg2000
ID: 8192099
I am using Tomcat 4. I thought WEB-INF/classes is implicitly configured as classpath already? If not, how and where should I add the classpath so that my applet can access the Jar file?

Thank you.
0
 

Expert Comment

by:bhayzone
ID: 8193110
I think ur /servlet OR /servlets must be configured to point to WEB-INF/classes

so try giving the following as ur archive

ARCHIVE="/servlet/test.jar"
0
Major Serverless Shift

Comparison of major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform

 
LVL 35

Expert Comment

by:girionis
ID: 8193793
 The WEB-INF fodler is in Tomcat's classloader's path automatically but applets are loaded from a different classloader.
0
 

Author Comment

by:zerg2000
ID: 8199469
So where should I add the classpath for my applet under the Tomcat environment?
0
 
LVL 35

Accepted Solution

by:
girionis earned 80 total points
ID: 8201439
 Can you tell me your classpath, where you applet classfile is and the <APPLET> tag in your html file? You will probably have to use the CODEBASE attribute inside your APPLET tag in order to load the applet from a different folder than your html file.
0
 

Expert Comment

by:CleanupPing
ID: 9058535
zerg2000:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9730789
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept girionis' comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jimmack
EE Cleanup Volunteer
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question