[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Java Applet Class file download

Posted on 2011-05-04
32
Medium Priority
?
819 Views
Last Modified: 2012-05-11
Dear Expert,
I get one Java Applet application running in my IE.The program is okay running in my IE really good.
I would like to download its class ile at http://data1.tutorial.com/applet/a.b.h.a.class
but it doesn't have such class file.

The question:
1-Is the normal if the class file name like a.b.h.a.class ?  could we have more than one "." in the class file name in Java ?
or a.b.h.a.class is equal to abha.class ?
2-If  codebase and code name is speficied with  http://data1.tutorial.com/applet/a.b.h.a.class
in <applet>  tab as follows provided by the site html page and If I can run the application succesfully with the class name,
I should be able to download it, But why not ?

Please advise

Duncan

<applet height="100%" width="100%" viewastext="" mayscript="" name="FullVer" codebase="http://data1.tutorial.com/applet/" code="a.b.h.a.class">

Open in new window

0
Comment
Question by:duncanb7
  • 14
  • 12
  • 5
  • +1
32 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 900 total points
ID: 35688670
You're mixing up the name with the package by the looks. a.b.h.a.class indicates that the applet is at <foo>/a/b/h/a.class
0
 
LVL 92

Assisted Solution

by:objects
objects earned 900 total points
ID: 35688684
> I would like to download its class ile at http://data1.tutorial.com/applet/a.b.h.a.class

class file (a.class) should be in

I would like to download its class ile at http://data1.tutorial.com/applet/a/b/h/a.class

> 1-Is the normal if the class file name like a.b.h.a.class ?  could we have more than one "." in the class file name in Java ?

the class name is only a.class
a.b.h is the package the class is in
which is used to look up the directory to find class (see point above)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35688702
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 200 total points
ID: 35688708
http://www.devdaily.com/java/edu/pj/pj010020

How to download a Java class file from an applet

If you see an applet that you like, downloading the class file(s) for that applet is generally pretty easy. Here are the steps:
The step-by-step process

   1. First, when you see an applet that you like, make sure you're looking at that applet in your browser (Netscape or Internet Explorer).
   2. With the applet in your browser window, click on View | Page Source (Netscape 4.x), or View | Document Source (Netscape 3.x), or View | Source (IE 3.x) from the pull-down menu in your browser. I don't have a copy of IE 4.x with me at this time, but I think you get the idea.
   3. Next, search for the text string "<applet" or "<APPLET" in the source code for that page. The idea is to find the beginning of the <APPLET ...> tag in the HTML source. This tag will tell you where the Java class file is located.
   4. When you find the applet tag, look for the name of the class file being invoked for the the applet. The tag will usually look like this: <APPLET CODE="MyApplet.class" WIDTH=350 HEIGHT=200></APPLET>
   5. This tells you that the binary file MyApplet.class is located in the same directory as the HTML file. Downloading the class file is very simple. Go back to your browser, and replace the name of the HTML file you're viewing with the name of the class file in the field where you'd normally type the URL.
   6. Hit the <Enter> key. Each browser behaves a little differently, but in general they'll prompt you to ask where you'd like to download the file to on your local filesystem. Store the class file wherever you'd like. (Note: If the browser tries to rename the file with a different filename extension like ".exe", just change the extension to ".class" before saving it.)

A step-by-step example

That's all you have to do. Does it seem too easy? Try it on our site. Here's how to download the class file for our popular AnimatedAd applet.

   1. Point your browser to "http://www.DevDaily.com/java/applets/AnimatedAd/AnimatedAd.shtml".
   2. Assuming you're using Netscape 4.x, click on View | Page Source.
   3. Search for the text string "<applet" or "<APPLET" in the source code for that page by hitting <Ctrl>F in the viewing window, then entering the string. You'll find that the applet tag shows that the AnimatedAd.class file is in the same directory as the HTML file. There are no directory paths preceding the string "AnimatedAd.class".
   4. Close you're viewing window and go back to your browser. In the browser's Location: field, replace the name AnimatedAd.shtml with the name AnimatedAd.class. The URL should now be "http://www.DevDaily.com/java/applets/AnimatedAd/AnimatedAd.class".
   5. Hit the <Enter> key. Netscape prompts you by asking where you'd like to save the file. Save it wherever you'd like, or cancel the process. Remember to rename the extension to ".class" if Netscape changes it to ".exe".

The process can get a little more complicated if the applet author uses a "CODEBASE" parameter with the <APPLET> tag, but this only means that they've stored the applet in a different directory. Just include any directory information you see in the URL tag when you replace the .html filename with the .class filename.

The process also gets more complicated if the author uses more than one class file to create their applet. For instance, our AnimatedAd applet requires a helper class named GetAppletParameter.class. Unfortunately, you won't know this until you decompile the AnimatedAd.class file.
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35688861
Dear CEJI,

http://data1.tutorial.com/applet/a/b/h/a.class is still report as follows

The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Please try the following:

    Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
    If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted.
    Click the Back button to try another link.

HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)

Technical Information (for support personnel)

    Go to Microsoft Product Support Services and perform a title search for the words HTTP and 404.
    Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Web Site Setup, Common Administrative Tasks, and About Custom Error Messages.
0
 
LVL 92

Expert Comment

by:objects
ID: 35688897
have you uploaded the class file to that directory?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35688906
You need to first of all determine which directory the applet is in - guessing won't help
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35688924
It will also help if you post the actual address of the page including the correct domain
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35688972
Sorry, The website is need  with login and password , and I just
type the path .../a/b/h/a/class at  working page's IE URL location bar after login successfully.
The cookies should be okay to upload the file since I am using the same IE window or object.


If you said correctly, it should be okay with .../a/b/h/a.class .

the only issue is authorization issue, if it is not allows  to access the site, it should report not HTTP:404 message
the server  will report to access deny or no access right such kind of message , Is it right ?
0
 
LVL 92

Expert Comment

by:objects
ID: 35688990
> the server  will report to access deny or no access right such kind of message , Is it right ?

thats right
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35689011
Yes, authorisation works the same as any other page
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35689041
Do you think ?

if I type the address .../a/b/h/a.class correctly, my cookies in the site will be sent to the server with
the address, or the server will request my IE automatically to send back the cookies for authentication check ?
So there is still two issue

1- class name in the path a.class or /ab/h/a/a.class or other we are missing
2- Cookies check by who, when and where before download the file ?

0
 
LVL 92

Expert Comment

by:objects
ID: 35689058
the class file would appear to not be in the correct directory
is it in /a.class
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35689064
the only information about class file is here
 <applet height="100%" width="100%" viewastext="" mayscript="" name="FullVer" codebase="http://data1.tutorial.com/applet/" code="a.b.h.a.class">
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35689071
Cookies won't be involved usually if you're downloading directly. Only when the applet is being displayed in the page as normal. Why would you WANT to just download the applet btw?
0
 
LVL 92

Expert Comment

by:objects
ID: 35689080
well that expects it to be in http://data1.tutorial.com/applet/a/b/h/a.class

If its not there then the applet has been deployed incorrectly
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35689081
If it's in the right place, it will be at http://data1.tutorial.com/applet/a/b/h/a.class
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35689166
After using http proxy software, I check all cookies is also sent to the server with http://data1.tutorial.com/a/b/h/a.class

So it seems only issue
actually, there is no such file  or a.b.h.a.class doesn't mean /a/b/h/a.class
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35689468
The applet appears when you access the page in which it's set?
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35689518
Yes, applet appear in my IE after login
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35689535
Then the applet must be where it says it is. Try downloading it with something else
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35689659
I 've download other file is okay, but the filename path has
a lot of variable for example
http:data1.tutorial.com/data.html?u=12&type=12&t=134780000&d=888593abvfdddffrfrr
And the variable is always changed so I need to re-click the button and go to http proxy
software to look at those http path.

Actually, the applet software is also provide to download the data file by Window dowload
Dialog menu and save as in PC. BUt the question I have 100 files needs to download,
I need to click a lot button to finish all of my download, so it is time cosumer.
I have tried to use VBA to do automation succesfully . But it is always occupying my computer
and I can't do other thing in PC during automation. So I thought
let it do it in my server by php if I know all data file full path and I can
access the website by curl in php

That is why I want to download applet class file and decomplier  to see how they generate
full file path such as
u= ?
type= ?
t= ?
d= ?

Probably  t= the time and date generated by javascript.
 
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35689693
>>but the filename path has a lot of variable for example


The applet file path is fixed - there are no scripts involved, so you would need to put a fixed url in
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35689702
And during php automation download programming in server and I will know
a lot of internet and software programming stuff.
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35689711
The data file is just raw data like the one in csv file. The fata full path
with variable change with time and coding ,  I think it is  because of security issue from the vendor
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35689726
>>The fata full path with variable change with time and coding,

The applet path can't change without redeployment of the applet
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35689751
redeployment of the applet

What is that mean of the word of  redeployment of the applet
?
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35690107
Do you understand my question?

The /a/b/h/a.class must exist and I am using firebug that also point
the <applet> when selct the applet working area.

If the class file is not existed I can not have applet display in my IE  
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35690433
Finally get the answer


After using Firebug, found there is one more applet tag
before the one applet I want to locate. Without running
the first one as follow, second one /a/b/h/a.class file is not
existed because the first one will  do file extraction  from the
file name at codebase and archive. Now I can directly download those
two file data.cab and data.jar. After unzip  data.cab into my PC , there is  a lot of
 files and directories such as C:\\document Setting\Administrator\downloads\a\b\h\a.class
So a.class is found.

First one
==========
<applet ....
<param name=cabbase value="Data.cab">
<PARAM NAME="archive" VALUE="Data.jar">
Second one
================
<applet height="100%" width="100%" viewastext="" mayscript="" name="FullVer" codebase="http://data1.tutorial.com/applet/" code="a.b.h.a.class">

Now it seems I go to Java programing and debugging and PHP coding for next

Thanks for all of your reply this thread

duncan


0
 
LVL 13

Author Closing Comment

by:duncanb7
ID: 35690460
Thanks for all of your reply
Now I am going to next and sleep

Bye Bye

Duncan
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35690470
Yes, that's unusual. They might have done that so that it can be run either way. Of course, without knowing that there was also an archive tag jar, no advice is possible...
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35694239
Sorry correct what I said for memo but the problem is also sovled
In firebug, it just show the code.
===========================
<tr><td>
<applet ....
<param name=cabbase value="Data.cab">
<PARAM NAME="archive" VALUE="Data.jar">
</td></tr>
<td></tr>
<tr><td>
<applet height="100%" width="100%" viewastext="" mayscript="" name="FullVer" codebase="http://data1.tutorial.com/applet/" code="a.b.h.a.class">
</td></tr>

But when using Charles' http proxy software,it show the second applet tag also with param
======================================================
<tr><td>
<applet ....
<param name=cabbase value="Data.cab">
<PARAM NAME="archive" VALUE="Data.jar">
</td></tr>
<td></tr>
<tr><td>
<applet height="100%" width="100%" viewastext="" mayscript="" name="FullVer" codebase="http://data1.tutorial.com/applet/" code="a.b.h.a.class">
<param name=cabbase value="Data.cab">
<PARAM NAME="archive" VALUE="Data.jar">
</td></tr>

SO in other words, when it includes param with archive and cabbase in applet tag  , applet will take care and
find the a.class file in jar file. and first tag of applet is no relation to second tag of applet.

For my memo only

Duncan

0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month20 days, 6 hours left to enroll

873 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