Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending an XML file form servlet to client

 
Murad Iqbal
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where you really have the problem
 
Murad Iqbal
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic