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

x
?
Solved

Problem about downloading JAR file

Posted on 2003-02-20
8
Medium Priority
?
215 Views
Last Modified: 2010-03-31
Hi,

I met an infrequent problem about downloading jar file. Is there anybody can help me?

Similar code as belows:
<APPLET WIDTH="500" HEIGHT="350" NAME="MyApplet" codebase="http://x.x.x.x/">
<PARAM NAME="ARCHIVE" VALUE="Applet.jar">
<PARAM NAME="CODE" VALUE="Applet.class">
</APPLET>

The problem is it will translate the codebase by some DNS server, (right?)
but it can NOT connect the DNS server now because the WEB server here is in
an intranet. The jar file can be download finally after about 6-20 seconds,
researched by sniffer, the time wasted in connecting the DNS(fail and retry
several times).
Analysis: Cause IE can consider the x.x.x.x as an IP, why it doesn't consider
the codebase as an IP but an URL? I think the codebase tag is transacted by JVM
but not IE (right?). Should it possible to let the JVM consider the codebase
as an IP but not URL(need to translate by DNS)?

thx!
MJ
0
Comment
Question by:popxw
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 7987304
Why are you not using the customary codebase="." (or some other relative url) btw?
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 7988047
This is what I found on w3.org regarding the applet tag;

"13.4 Including an applet: the APPLET element
APPLET is deprecated (with all its attributes) in favor of OBJECT.

See the Transitional DTD for the formal definition.

Attribute definitions

codebase = uri [CT]
This attribute specifies the base URI for the applet. If this attribute is not specified, then it defaults the same base URI as for the current document. Values for this attribute may only refer to subdirectories of the directory containing the current document. Note. While the restriction on subdirectories is a departure from common practice and the HTML 3.2 specification, the HTML Working Group has chosen to leave the restriction in this version of the specification for security reasons."

So, basically, it conforms with the standard sand box approach to applets. Can only retreive files from the current server.

My advice to you would be to create a signed applet, that then loads whatever classes you want from the remote jar. Or even better, host the jar on your own server!
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 7988084
Oh, and you need to specify the 'code' attribute to tell the browser which class to load, e.g. code="MyApplet.class".

You can try the 'archive' parameter to specify where to load the jar from, it might actually work loading from a different site...

The 'name' you specified is only to allow other applets to access that applet by name. It does not tell the browser which class to load for the applet.

You can find more information at;
http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.4

Based on your html code, try this;

<APPLET WIDTH="500" HEIGHT="350" CODE="MyApplet.class" NAME="MyApplet" ARCHIVE="http://x.x.x.x/">
<PARAM NAME="ARCHIVE" VALUE="Applet.jar">
<PARAM NAME="CODE" VALUE="Applet.class">
</APPLET>
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:popxw
ID: 7990741
Hi, CEHJ

I've tried to use codebase=".", but the same result.

MJ
0
 

Author Comment

by:popxw
ID: 7991211
Hi, CEHJ

I've tried to use codebase=".", but the same result.

MJ
0
 

Expert Comment

by:CleanupPing
ID: 9059213
popxw:
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 7

Expert Comment

by:tomboshell
ID: 9553603
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:
SPLIT between CEHJ and orangehead911 because I am unsure of the results/solutions offered.  orangehead911 offered some good information and CEHJ tryed to get the questioner to format the codebase for the intranet.  If anyone has more information or clarifications then PLEASE contribute.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thomas Boshell
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 9603121
PAQed, with points refunded (200)

Computer101
E-E Admin
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

580 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