This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes maintain single session from applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "maintain single session from applet" Watch "maintain single session from applet" New topic
Author

maintain single session from applet

bhar kup
Greenhorn

Joined: Nov 04, 2008
Posts: 6
I have a requirement where, if i click on download button, a webpage will be displayed and there i can browse and start download.
(download will be done from client machine to server. i can access server using an ip and with respect to the server, i download a file from client machine).

Now when i start downloading from client machine to say server X,
and i try to do the same(download) to different server sat Y,

The first Download (for X) will get stopped and (webpage for downloading) second server(Y)download page is displayed.


My requirement is, if i say download from second server when first servers download is in process, it should not interupt the first download.

I need one download per PC.

Can some one tellme how to proceed.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41036
    
  43
Welcome to JavaRanch.

I'm a bit confused by "downloading from the client to the server". Downloading refers to the opposite - transferring a file from a server to a client. Maybe you can clarify which one you're doing.

I'm also unclear about how these downloads/uploads are handled - by Java code in the applet, or by the browser as the result of clicking on a link? If the latter, where does Java come into play? If the former, how does a download get stopped - are both of them started from the same applet on the same web page?


Ping & DNS - my free Android networking tools app
bhar kup
Greenhorn

Joined: Nov 04, 2008
Posts: 6
Actually we have NEs(Each NE has an ip.)

if we have to upload any file to NE, we can just FTP the file to NE.

Instead of FTP, we try to do it form GUI.

Where, we access the NE first with the ip, then from that NE, we say download (this download will be from client machine to NE with respect to NE).

We use Javascript for GUI parts.

When we say download software, a new web page is opened. Here we browse the required file and say download. This calls an applet(.java) where it starts (FTP)downloading file.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41036
    
  43
OK, I don't think I fully understand (e.g., what are "NE"s?), but it sounds as if you have a web page containing an applet that uploads a file from the client to the server, and that the upload is terminated if the web page is replaced by another page before the upload is complete; is that correct?

If so, there's no real way around that, because an applet stops executing if the page it's on is no longer being displayed. Maybe you can enhance the applet so that it allows several simultaneous uploads?

If that's not the problem, try to elaborate on the flow (like which page shows what, what happens if a link is clicked, when pages are replaced by other pages, when the applet is started, etc.)
bhar kup
Greenhorn

Joined: Nov 04, 2008
Posts: 6
There was little confusion in the requirement.

The way we access NE is same. But parallel download from 1Pc should be possible.

Right now, if the 2nd NE opens the download window, the first NE's download process is getting interrupte(Applet is stopped automatically).

As you said, enhance the applet so that it allows several simultaneous uploads?

Please guide me how to do that from applet..

Please help..
bhar kup
Greenhorn

Joined: Nov 04, 2008
Posts: 6
NE is a NetworkElement. It is a hardware.

One more point to notice is
If i start download (for 1st NE) in firefox, i am able to download (for 2nd NE) from IE.

Problem comes when i try both the NEs from FireFox or IE.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41036
    
  43
If i start download (for 1st NE) in firefox, i am able to download (for 2nd NE) from IE.

You should be able to open two windows/tabs in the same browser, and have them both run the applet for different files, no? Or does the server not support that?

As to uploading two files from the same applet, that of course depends on the server supporting that, too. If the server has the concept of a client session (or something similar), it may not.
 
 
subject: maintain single session from applet
 
Similar Threads
Keeping count of downloaded file
Opening a text file on client machine editor
How to populate a value in text box
RMI Testing
How to download the file to the client machine