inzaghi
asked on
HttpServlet
I have a servlet which streams content to the brower using
response.setDateHeader("La st-Modifie d", DateUtils.now().getTime()) ;
response.setHeader("Expire s", "-1");
response.setContentType(co ntentTYpe) ;
response.setHeader("Conten t-Disposit ion", "attachment; filename=" +fileName);
I have an if condition which only does the above if there is content to stream. This content comes from the database.
If there is content it works as it should, ie displays a dialog window to open or save.
If there is no content then I just want to return from this servlet. What happens is that the browser points to this servlet
eg.
http://localhost:7001/cart/dowloadServlet
What i want is the original jsp to display where the user clicks to do the download.
Any ideas?
response.setDateHeader("La
response.setHeader("Expire
response.setContentType(co
response.setHeader("Conten
I have an if condition which only does the above if there is content to stream. This content comes from the database.
If there is content it works as it should, ie displays a dialog window to open or save.
If there is no content then I just want to return from this servlet. What happens is that the browser points to this servlet
eg.
http://localhost:7001/cart/dowloadServlet
What i want is the original jsp to display where the user clicks to do the download.
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If the original page is called original.jsp, then control should be returned to that page with the above code. The save/open dialogue should only appear if a file is abouyt to be downloaded, but since ther isnt one (in the case where there is no content), then you'll have to select a different file, am I right? Does original.jsp not do this?
:)
ASKER