-
problem with showModalDialog whenever server sends a new session cookie
Hi,
In our application we display a pdf to the user in a modal dialog whenever he clicks on the view button. We use siteminder for authentication.
Only on certain machines we sporadically get a blank modal dialog instead of the pdf. I used HttpAnalyzer to check on the HTTP requests and response. I found that whenever in case of a call to DisplayPDFServlet(see the code below to understand the calls) the siteminder does a "Set-Cookie" in the response, I get a blank modal dialog and the Response content is empty.
I tried to match my IE setting with the machines which do not have this problem, but it has been of no use.
The view action is handled in the code as follows:
1. Call a struts action class which fetches the pdf and puts it in session.
2. In the jsp to which the control is now directed to, we have an object tag wherein the value is a call to a servlet which gets the pdf from the session and writes it to the outputstream
Object tag in the jsp:
<object id="demo" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="750" height="530">
<param name="SRC" value="servlet/com.dcs.century21.display.util.DisplayPDFServlet?<%=System.currentTimeMillis()%>">
</object>
Servlet Code
public void doPost(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
HttpSession session = request.getSession();
response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1
response.setHeader("Pragma", "no-cache"); //HTTP 1.0
response.setDateHeader("Expires", 0);
//prevents caching at the proxy server response.setContentType("application/pdf");
response.setHeader("Content-Type", "application/pdf");
response.setHeader(
"Content-Disposition",
"inline;filename=somepdf.pdf");
java.io.OutputStream outputStream = response.getOutputStream();
if (session.getAttribute("contractDocumentByteData") instanceof byte[])
{
byte[] data =
(byte[]) session.getAttribute("contractDocumentByteData");
if (data != null)
{
response.setContentLength(data.length);
session.removeAttribute("contractDocumentByteData");
outputStream.write(data, 0, data.length);
}
outputStream.flush();
outputStream.close();
}
}
Please Help!!!
Similar Threads
-
By yuvrajsurvase in forum Java
Replies: 0
Last Post: 06-01-2006, 09:02 AM
-
By Aditya in forum Database
Replies: 0
Last Post: 04-29-2002, 07:39 AM
-
By Beginner-Brad in forum Database
Replies: 1
Last Post: 12-31-2000, 02:03 AM
-
By Dan Donahue in forum Database
Replies: 0
Last Post: 12-27-2000, 04:22 PM
-
By George Kayumov in forum ASP.NET
Replies: 0
Last Post: 11-29-2000, 05:48 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|