Posted on 2007-07-23
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

    sounds like its caching the result.
    try adding a dummy arg with a unique vale (such as a timestamp) to the url

    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    Understanding websocket example in spring 1 20
    pairs challenge 5 28
    Using "ScreenUpdating" 6 32
    Sum Per Month 7 23
    Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
    Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
    The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
    This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now