File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes refreshing before file download prompt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "refreshing before file download prompt" Watch "refreshing before file download prompt" New topic
Author

refreshing before file download prompt

Bill Brasskey
Ranch Hand

Joined: Jun 01, 2004
Posts: 47
I have an app where I query a db according to criteria selected by user on form page, and put the resultset into a ".csv" file for them to download. Form page on index.jsp, processing done in process.jsp....
If query returns no data, I show a message on form page next to dropdown telling user there's no data for that selection. If data returned, I send a redirect(from form page) to the url of the data file. The Windows "file download" system prompt comes up, user downloads file. Problem is, if a query returns data and there's a previous error message on the form page, the download prompt pops up, user downloads the file and message is still there. I want to refresh the form page prior to the download prompt popping up, so if data is returned, the error message goes away. Any advice will be much appreciated.
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
If an error doesn't mean anything to the user and should just be ignored, I would just not send it in the first place or clear it on the server if it was already there from before. I don't think you need to go the route of refreshing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: refreshing before file download prompt
 
Similar Threads
The page doesn't gets refreshed
RequestDispatcher - regarding
[S2] Multiple files sent simulatneously with out.write() results in corrupted data streams
Resin DB-pooling + authentication. HELP!
Received xmlhttp result, want to allow user to download - how?