Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp and text file

 
ibnu ros
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a project using jstl. how can I query data from my sql server and fetch into text file and user can download that text file.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would have nothing to do with JSTL or JSP. If you want to return a text file as a response, simply emit the text as the response and set the content-type to "text/plain".

If you want to force a download (rather than displaying in the browser), be sure to set the content-disposition such that the response is an attachment. (Do a search for exact syntax.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic