aspose file tools*
The moose likes Servlets and the fly likes Sending an XML file form servlet to client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending an XML file form servlet to client" Watch "Sending an XML file form servlet to client" New topic
Author

Sending an XML file form servlet to client

Murad Iqbal
Ranch Hand

Joined: Dec 09, 2003
Posts: 90
Hi all!

I am having a bunch of XML files in a particular directory at my server end. The servlet can access the directory. The clients are supposed to access the home page of this website which lists the names of these xml files. The file names are stored in a database and are accessible easily. When the client clicks on the names of that XML file seen on the jsp page, I need to pick up that file and transfer to the client. How can this be done? I am using only 1 servlet for this small application. Any ideas?

Regards,
Murad.
Babar Qadri
Ranch Hand

Joined: Oct 12, 2004
Posts: 51
where you really have the problem


babar
Murad Iqbal
Ranch Hand

Joined: Dec 09, 2003
Posts: 90
What I dont know how to do is 'to send a file to the client throught servlet after the client clicks on a particular xml file name. its similar to downloading a file.' I guess it has to go throught the servlet...
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
It sounds quite simple to me. But may be I am not getting the real context of the problem.

- just store the the file names along the real paths of the files.
- make a link in your jsp page. that the user can right click over it and save the target as whatever.

not sure if you are expecting something else. but deserve a thanks because just placed your post on the top of the list again.

cheers
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Sending an XML file form servlet to client