This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to download a huge file from server

 
Marian Kulisch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I work with Websphere. There is an JSP for downloading a huge file until 12MByte. This works fine and without using an servlet... but two problems are there:
first problem:
- during the download the server is busy with 100%
- download takes more time 20 minutes or more
- download rate is only 7 kbyte per second
- client is an internet explorer version 5xx until 6xx
- my code snippet:
PrintWriter pw = response.getWriter();
IModule module = createModule();
module.write(pw); // here only pw.write(...) init
pw.flush();
pw.close();
- other users have to wait long for their requests

second poblem:
- if an user closed the internet explorer, the server will not feel this event and do not stop sending data... until all data are send.
- if an user answer the pop up of internet explorer for downloading with "cancel", the server will be also not stop sending data... until all data are send.

How could i insert any thread support for sharing the 100% busy of server in my jsp?
How could i send an signal for stopping download in my jsp, if the user closed the internet explorer suddenly?

I can not imagine myself, that i should use servlets for providing downloads of huge files... because servlets in websphere are difficult to admin and handle.

I am not sure about this topic - jsp or websphere problem?

[Bear edit: removed shouting from title]
[ November 30, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Marian.

When posting, please refrain from using all uppercase. It's considered "shouting" and is rather rude. I have changed the title to mixed case for use.

As to

because servlets in websphere are difficult to admin and handle.


How so? Does websphere require special care when deploying servlets?
 
Paul Clapham
Sheriff
Pie
Posts: 20768
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't found servlets to be difficult to administer in Websphere, but then I use a tool-program to generate the EAR files. If you have to install new versions of your servlets frequently it can be inconvenient, since you have to stop and start your web application, whereas you can just bung a JSP into the application and have it recompiled right away. However I work in an environment where we don't have to do frequent changes of our code, so it isn't a problem. Also, we use persistent sessions and have a script to re-install the EAR file which takes only a minute to run, so it isn't a major deal to do that. We use servlets to do the prep work and JSPs to generate the HTML, so if we were doing downloads we would use servlets to do them.

Anyway, to sort of answer the original question, I don't think it makes any practical difference whether you use a servlet or a JSP, since a JSP is a servlet anyway once it's compiled. They would both work the same way. So if you're looking for a solution, don't look in the JSP. Look in Websphere or in the web server you have between it and the Internet, if there is one, for a possible solution. I don't know what that might be, sorry.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the servlets forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic