aspose file tools*
The moose likes Servlets and the fly likes File Download Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "File Download" Watch "File Download" New topic
Author

File Download

Eibhlin Reid
Greenhorn

Joined: Nov 04, 2004
Posts: 28
Hi there,

I have never used servlets before but I was wondering if there is a way to use them to allow a user of my program to download an XML file off of a server. I know I could do a website using EJBs (which I have some experience of) but I would just rather the user click a button on the application to start the download instead of having to go to a website to download the file.

Is this knid of thing easy to do? All help greatly appreciated!

Thanks in advance!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

A servlet (as it's name suggests) a server component. It sits on the server and waits for a request.

The request can come from a browser or from any application that can generate an HTTP request.

What type of app are you writing?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Eibhlin Reid
Greenhorn

Joined: Nov 04, 2004
Posts: 28
I'm writing an application to remove adware/spyware from a windows machine. I would like users to be able to download updates to the definitions file, but wanted something thats quick and easy for both them and me!!
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
The HttpClient classes can be used to emulate a browser making a request.
See this Jakarta commons project page.
Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: File Download