Controlling the title of a JSP page

Discussions

Web tier: servlets, JSP, Web frameworks: Controlling the title of a JSP page

  1. Controlling the title of a JSP page (3 messages)

    Hi,

    I'm stuck with a problem. The title of JSP page changes the moment a PDF page is downloaded to the browser. Is there any way to control of having the same title, as it was there before downloading PDF into the browser. I'm using java script to download the pdf. I'm not using windows.open() also. I saw some of the article mentioning about changing the value by setting document.title but it doesn'work either. Any advice ont this will be very helpful.

    Thanks in advance,
    Sandesh

    Threaded Messages (3)

  2. Hi,
             Try to use IFRAME For displaying PDF.that's work for ur problem.
  3. IFrame for PDF title?[ Go to top ]

    Hi all,

    This is my JSP code, I'm calling the action class mapping from my JSP code as part of IFrame. It downloads the PDF into my browser, but still the title is not retained. Can you have look at my JSP and let me know what am I doing wrong in the JSP.

    <%@page contentType="text/html; charset=shift_jis" %>
    <%@ taglib prefix="logic" uri="/tags/struts-logic"%>
    <%@ taglib uri="/tags/struts-html" prefix="html"%>
    <html>
      <head>
        <title>ƒAƒhƒŒƒXƒJ[ƒh</title>
        <script language="javascript">
          function onLoadSubmit(){
            if(document.forms[0].subChk.value==""){
              document.forms[0].submit();
            }
          }
        </script>
      </head>
      <body onload="onLoadSubmit();">


    <iframe src="/addressCardPdfPrint.do" width="100%" height=300
    align="left" scrolling="yes" marginwidth="10" marginheight="0" name="addressCardPdfPrintActionForm">
    </iframe>



      </body>
    </html>
  4. Iframe doesnt work this way[ Go to top ]

    <%@page contentType="text/html; charset=shift_jis" %>
    <%@ taglib prefix="logic" uri="/tags/struts-logic"%>
    <%@ taglib uri="/tags/struts-html" prefix="html"%>
    <html>
      <head>
        <title>root</title>

      </head>
      <body>
    <iframe src="/addressCardPdfPrint.do" width="100%" height=300
    align="left" scrolling="yes" marginwidth="10" marginheight="0" name="addressCardPdfPrintActionForm">
    </iframe>
      </body>
    </html>


    This also doesnt work. Any idea how to retain the PDF title. I don't want to use multiple JSP page. I want to use the same JSP page to display the pdf. So any idea guys.