Posted on 2007-07-23
Medium Priority
Last Modified: 2013-11-24
I am currently using jexcel api 2.6.4 to output a database query to an excel file from a jsp webpage.  From a jsp file, I call a java class that does the following:
      response.setHeader ("Content-Disposition", "attachment;filename=fileName");

     ServletOutputStream sos = response.getOutputStream();
      FileInputStream file = new FileInputStream(theFile);
and I plug the input stream to the servlet output stream.  I need a user to be able to run multiple searches and produce different excel worksheets but the problem is that if a user has a previously generated output file open, running the webpage search again just throws focus to that previously generated report.  What's going on?
Question by:mynus482
LVL 92

Accepted Solution

objects earned 1500 total points
ID: 19552411
sounds like its caching the result.
try adding a dummy arg with a unique vale (such as a timestamp) to the url

Author Comment

ID: 19556905
Actually, when I was creating the excel file, I was using a hardcoded name for it.  Appending a random string to differentiate each file fixed the problem. Thanks.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question