> response.setHeader("Expires", "0"); > response.setHeader("Cache-Control", "no-cache");
This was what Struts Action Servlet processNoCache(response) do. We can simply set init parameter nocahe to "true" in web.xml. This is working fine for all the JSP caching. But what is happening is: Click a button "generate report", opens up a PDF file(in new window) and close that window. Next click on another button "view some page", should open a new page, because it has different action mapping. But instead it is opening the prevoius PDF file. (If I refresh main page, it works fine). How to avoid caching of PDF file? > response.setHeader("Content-disposition","attachment; filename=" + filename); I don't have a file name for the pdf I generate (may be I can have one). I use iText Document, add contents and close the document. The Action class returns a NULL Action Forward. Any way, Thank you. -- Vip. -----Original Message----- From: Vincent Aumont [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 2:15 PM To: Struts Users Mailing List Subject: Re: some PDF stuff Vip, > Is there a way to open PDF in a separate acrobat window, > by not changing the acrobat reader 'Preferences/General/Options'?. n the action that returns the PDF, setting the Content-disposition to 'attachment' in the HTTP header will cause the browser to open a File Download dialog that will ask the user whether he wants to open the document from the current location of to save it to disk. Setting it to inline will cause the document to be opened in the browser. Might ne be exactly what you want but it works will all versions of Acrobat. Note: for this to work, the file must have the proper extension and must not include the full path (just the file name). Example: I response.setHeader("Content-disposition","attachment; filename=" + filename); > > How to avoid caching of PDF files and not only HTML files. response.setHeader("Expires", "0"); response.setHeader("Cache-Control", "no-cache"); -Vincent. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>