Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

UnZipping Occurs in Server System only

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Im new to Java. In my web application, I have to download a zip file from ftp server and unzip that file to local system.I have written a servlet code and got the output successfully in server system(my system).The problem is when i run this servlet from client (another system),the zip file get unzips in server system only.not in client. I dont know where is the problem and what is the problem.. I could not able to find any solution. Please provide me some solutions or suggestions.Any body have got these kind of errors? I have used Streams to download and unzip a zip file and an input dialog box in swing to get destination folder path from client (to store the unzipped files). Below the complete code.
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All the Java code in a servlet -- every line of it -- runs on the server. None of it runs on the client. A servlet's only "GUI" is HTML. You can't put Swing code in a servlet. If you need to have Java code run on the client, then you need to use either an applet that can be embedded in the servlet's HTML output, or a separate Swing application that the user needs to install separately; either of these would have to explicitly communicate with the server via HTTP.

Since your followup questions are all going to relate to servlet application architecture, and aren't really I/O related, I'm going to move this to our "servlets" forum.
 
Sheriff
Posts: 67618
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's leave this one open; the other one in I/O is closed.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to create a servlet that on request from client would get the required zip from the FTP server and then stream it out to the client's response.The client can then expand the jar/zip in his local system.

Server would just act as the mediator between the requesting client and the FTP server.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic