Re: save result to text file in JSP

From: Chris Smith (cdsmith_at_twu.net)
Date: 04/30/04


Date: Thu, 29 Apr 2004 19:10:35 -0600

Jason wrote:
> I have a JavaServer Page which get data from database then display it for user
> to review; and now, how can I have a button somewhere in the result page which
> let user save current result to a text file.

Since you just said that you've tied your database access to the JSP,
you'd have to rewrite the database access code to do this.

The better solution, though, would be to write the code to access the
database in a Java class, and have it return the data in some kind of
straightforward data structure. You could then call that code, and
store the result in the session; and then the JSP could display it as a
web page, and the button could submit to a servlet which sends back the
data in a text format.

-- 
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation