Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Newbie : Applet question

Posted on 2003-03-22
9
Medium Priority
?
285 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
8 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

571 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