Forum Stats

  • 3,875,869 Users
  • 2,266,977 Discussions


exporting data from a jsp to a text file...

843834 Member Posts: 49,972
edited Jul 27, 2001 11:23AM in Java Technology & XML
Hi all.
I have a jsp which displays a set of results in a tablular clients now want me to include a button in this jsp page on clicking which i will be abl�e to export the entire data from the displayed page to a text file
can anyone suggest me as to how to go about it...


  • 843834
    843834 Member Posts: 49,972
    Server side code(lets say servlet named exportServlet) behind the button can retreive the data in the same fashion as done for displaying on the JSP.
    But then, exportServlet writes data back on the HTTP response using the mime type application/octet-stream.
    See Javadoc for javax.servlet.ServletResponse.setContentType()
This discussion has been closed.