• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

refreshing before file download prompt

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!