File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes jsp and text file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp and text file" Watch "jsp and text file" New topic

jsp and text file

ibnu ros

Joined: Nov 28, 2012
Posts: 2
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

Joined: Jan 10, 2002
Posts: 60049

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.)

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: jsp and text file
Similar Threads
how can i resultset data to text file in a table format
can i use an xml file for internationalized text instead of
Eclipse Plugin
Save a String to a Text File,
jdbc text drivers