problem with showModalDialog whenever server sends a new session cookie


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: problem with showModalDialog whenever server sends a new session cookie

  1. #1
    Join Date
    Jun 2006
    Posts
    2

    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!!!

  2. #2
    Join Date
    Jun 2006
    Posts
    2
    Hi,

    I have figured out the problem here. I was using Adobe 6.0 on my machine. There are compatiblity issues between siteminder and Adobe 6.0. Adobe has fixed this issue in the patch Adobe 6.0.1. Upgrade of Adobe will resolve this issue.

    Regards,
    Vinay

Similar Threads

  1. session tracking problem
    By yuvrajsurvase in forum Java
    Replies: 0
    Last Post: 06-01-2006, 09:02 AM
  2. Replies: 0
    Last Post: 04-29-2002, 07:39 AM
  3. Replies: 1
    Last Post: 12-31-2000, 01:03 AM
  4. connection problem with SQL Server 2000
    By Dan Donahue in forum Database
    Replies: 0
    Last Post: 12-27-2000, 03:22 PM
  5. Session Management with a site server
    By George Kayumov in forum ASP.NET
    Replies: 0
    Last Post: 11-29-2000, 04: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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center