Jsp:include static svg does not work

I am running tomcat4- and I have a jsp file that outputs svg content like so:
<?xml version="1.0" encoding="US-ASCII"?>
<%@ page contentType="image/svg+xml"%>
This works fine- the problem is that up until now I have included other svg widgets like this:
<g id="radio_off" >
               <%@ include file="../graphics/radioButton.svg" %>
          </g>
which also works just fine. Now, I have to change this to pass in a dynamic directory containing the image (there will be various directories with same file name- I determine at runtime which directory to use)- so I have to use a jsp:include instead.
When I do this:
<g id="radio_off" >
<jsp:include page="graphics/radioButton.svg" flush="true"/>
          </g>
When it is run I just get:
g id="radio_off" >
          </g>
Just blank inside the <g> . If I change radioButton.svg to radioButton.jsp and say:
g id="radio_off" >
<jsp:include page="graphics/radioButton.jsp" flush="true"/>
          </g>
Then I get what I expect with
g id="radio_off" >
<svg width="15" height="15">
....and so on
          </g>
I thought jsp:include would include the static content of a file (like html or svg), but apparently only the OUTPUT of that file.....
Is this correct- I cannot get my svg content to be included in the svg by using jsp:include or am I missing something?
I think it will be strange that I have to rename all my svg files jsp to get them included...Anu ideas???
Thanks,
Jim

Michael,
You are right- I reread your post more closely and saw that you are suggesting to basically just map all my static files (like the .svg) into .jsp extensions- which is basically what I was asking was true- that for svg, xml, htm, any static content to be included as in the <%@include directive but using the action <jsp:include it needs to either be changed to the extension .jsp or, as you suggested, mapped in the web.xml to .jsp. I have remapped my svg to .jsp so as to preserve their .svg extensions- (of course now the first user is hit by about 20 jsp:init's on that page!!- but is then cached as in all jsp's).
I guess kinda makes since since the include action gets the actual response from the page (which is blank image)- but as jsp it is the actual code....Well needed confirmation- and that's what I got along with the reminder to use the mapping in web.xml.
So thanks alot- even put extra duke in for you !!
Jim

Similar Messages

  • Jsp:include of html file not working

              Hi
              I wrote:
              <jsp:include page="include.html" />
              <% pageContext.include("include.html"); %>
              in my jsp, but there is no output and no error message.
              What could be the problem?
              If I include include.jsp it works.
              Does jsp:include only work with jsp, not with html???
              I am wondering whether our servlet registrations could be responsible. We have:
              weblogic.httpd.defaultServlet=*.jsp
              weblogic.httpd.register.*.jsp=weblogic.servlet.JSPServlet
              weblogic.httpd.register.*.htm=weblogic.servlet.FileServlet
              weblogic.httpd.register.*.html=weblogic.servlet.FileServlet
              so that the default servlet is the JSPServlet, not the ServletServlet. We don't
              want to use the ServletServlet because it can deliver source code.
              What we want to do is a dynamic including of a file, like so:
              <% String s = ...; %>
              <jsp:include page="<%= s %>" />
              Thanks for any help.
              Alex
              

              By changing the weblogic servlets that are registered, I can get it to work. The
              combination that works is:
              weblogic.httpd.defaultServlet=file
              weblogic.httpd.register.*.jsp=weblogic.servlet.JSPServlet
              weblogic.httpd.register.file=weblogic.servlet.FileServlet
              I am surprised that it doesn't work if *.html is mapped explicitly to the FileServlet
              (which would leave the defaultServlet unused). Why is that?
              And why can't I map defaultServlet to "weblogic.servlet.FileServlet" directly,
              without the intervening virtual name "file"?
              What are the security implications of having FileServlet as the default servlet?
              Thanks
              Alex
              

  • Include in Export does not work in APEX 3.1

    I have a report with many columns. On screen I only show several columns, but on export to CSV I want to include all columns.
    However, when "Show on Report" is set to No, and I want to set "Include in Export" to Yes on the "Print Attributes" tab, it does not get updated.
    It only gets updated when the "Show on Report" is set to Yes.
    It also seems that the "Include in Export" on the "Report Attributes" tab is not in sync with the "Include in Export" on the "Print Attributes" tab the first time you access the "Print Attributes" tab.
    Question: Does "Include in Export" only works for columns which has the "Show on Report" set to Yes? If Yes, how can I achieve the above mentioned?
    Guido

    Marc,
    After some investigations the following can be concluded:
    On the Report Attributes tab, pick a column, and set "Show Column" to Yes, "Include in Export" to Yes, and no conditions.
    I do not want this column to be printed, so on the Print Attributes tab, set the "Column Width" to 0.
    When you run the report, you will notice that the column is not included in the export to CSV and not printed.
    Setting the "Column Width" to a value greater than 0, the export to CSV works fine, but the column is also printed.
    You can have a look at page 1 at at http://apex.oracle.com/pls/otn/f?p=261 (demo/ankpm)
    Thanks Patrick for your solution (:REQUEST LIKE 'FLOW_EXCEL_OUTPUT_%'), it works great. The column is now not show on screen but included in the export to CSV. However, you have to set the column width to a value greater than 0.
    An enhancement request for 4.0 could be to also have a property "Include in Print", and that this property and "Include in Export" are not dependent on the "Show Column" value.
    Guido

  • Stylesheet does not work correctly

    I have web pages in the root and sub directories:
    /index.jsp [ <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>  ]
    /folder/list.jsp [ <link href="../resources/stylesheet.css" rel="stylesheet" type="text/css"/> ]
    /resources/stylesheet.css
    index.jsp has hyperlink to list.jsp and list.jsp has hyperlink to index.jsp.
    When app start, stylesheet is correctly applied to index.jsp. After I go to list.jsp and return back to index.jsp using hyperlink, stylesheet does not work anymore.
    Did anyone had similar problem? Do you have any workaround solution?
    Please help.

    I have not found anything in JSC that helps creating context url for stylesheet reference. Here is ugly hack I use for root page:
    /index.jsp [ <link href="/webapppath/resources/stylesheet.css" rel="stylesheet" type="text/css"/>  ]I will appretiate if anyone has more elegant solution or give more insight into JSC.
    Thanks!

  • Why this does not works??? (I use jsp: include. to contain two jsp files)

    I have a main.jsp, and in this main.jsp, I have two part, leftButton.jsp and view.jsp, I want to include the leftButton.jsp and view.jsp to main.jsp.
    The code of main.jsp is like follows:
    <%@ page language="java" contentType="text/html" %>
    <html>
    <head>
    <title>JSP include element test</title>
    </head>
    <body>
    <table>
    <tr>
    <td><jsp: include page="leftButton.jsp" flush="true"></jsp: include></td>
                             <td>     <jsp: include page="view.jsp" flush="true"></jsp: include></td>
                        </tr>
         </table>
    </body>
    </html>
    Why the include does not works? by the way, I embeded a flash.swf file in view.jsp.

    Hi Mellon,
    You might be better off using a JSPF segment for leftButton.jsp & view.jsp and the <%@ include file="relativeURL" %>.
    Be careful that the included file does not contain <html>, </html>, <body>, or </body> tags. Because the entire content of the included file is added to the including JSP page, these tags would conflict with the same tags in the including JSP page, causing an error.
    Note: It is conventional to put JSP segements under the WEB-INF/jspf/ folder so the file cannot be accessed directly by a URL
    Note: JSPF files end with .jspf, so your files would be leftButton.jspf and view.jspf.

  • Mavericks static ip doesn't on wifi does not work

    MBA 2011
    MAC OS 10.9.4
    Wifi does not work with a static IP address.
    My wifi access point does not have DHCP enabled, and there is no DHCP server on my network. The internet connection is NOT coming my wifi router.
    Every machine on the network has a static ip address and manually configured DNS and GATEWAY to my correct gateway IP. This currently is working on this machine (windows 7), my ipad 2, my xperia phone, my windows xp box, my vista box, and even a virtual pc running windows server which is on my mac.
    But the mac won't connect to the internet, or ping anything including the gateway ip address or any other machine on the ip address.
    how can i get this mac to have a static ip address without having dhcp

    Going to System Preferences -> Network, and selecting Wi-Fi in the left pane.... Questions:
    . does the Status in the right pane show connected?
    . if so, does the Network Name: reflect the name of the network you assume it should be connected to?
    . if so, clicking on the Advanced... button and choosing the TCP/IP tab:
        . is the Configure IPv4 pulldown set to Manuallyh?
        . if so, have you entered in a valid router value (to mirror what you have set on the other working devices), and an IP address which you know is not already in use on the network?
        . if so, when you Ok out of this sheet panel, if you run /Applications/Utilities/Terminal and in that window type "ifconfig" can you find a configured network device with the address information you've entered (likely either en0 or en1)?
    If all as anticipated by here:
    . what message do you see in the terminal window when you do a ping to the access point's address?
    . are you super-sure that address isn't already in use on the network (e.g on a device already on the network successfully and with your MBA's wifi turned off, try pinging the thought-to-be-free address to see if something answers back).

  • I have recently upgraded my iMac Intel G5 iSight to OS 10.6.8 and now the internal mic does not work with skype or facebook. I can here static when playing back clips. Do I need to update firmware or reload old sys parts

    I have recently upgraded my iMac Intel G5 iSight (iMac5,1) to OS 10.6.8 and now the internal mic does not work with skype or facebook. I can here static when playing back clips. Do I need to update firmware or reload old system parts. I have zapped PRAM. The blue indicator in system audio panel will appear for a second as I slide the bar for internal mic but then it disappears. Is there a fix?

    The sound seems very faint but can here static on playback.

  • I get this error when I go to imovie, I have instalerat on via appstore, but it does not work. The QuickTime components necessary to view, edit, import and export various types of films are not installed. The components included in the iMovie installer. R

    I get this error when I go to imovie, I have instalerat on via appstore, but it does not work.
    The QuickTime components necessary to view, edit, import and export varioustypes of films are not installed. The components included in the iMovie installer.Reinstalling iMovie.

    I get this error when I go to imovie, I have instalerat on via appstore, but it does not work.
    The QuickTime components necessary to view, edit, import and export varioustypes of films are not installed. The components included in the iMovie installer.Reinstalling iMovie.

  • Western iso 8859-1 character set is gone, "other (including Western" does not work. Why did you take it out?

    Some websites need Western ISO 8859-1 character set to run properly and you have taken it away in favour of "other(including Western)", now the site does not work properly. Why did you take it out and can you please put it back.

    ISO-8859-1 and Windows-1252 should be equivalent. Can you provide an example of a page that doesn't display properly?
    If you have to manually select a character encoding to view the page correctly, then the site is broken and you should notify its owner that it needs be fixed. Websites specify the character encoding in one of two ways:
    * [http://www.w3.org/International/tutorials/tutorial-char-enc/ Handling character encodings in HTML and CSS | W3C]
    # The ''Content-Type'' response header.
    # The ''meta'' tag in the page source.
    ''Henri Sivonen (:hsivonen) wrote:''
    <blockquote>We are in the process of implementing http://encoding.spec.whatwg.org/ . The process involves removing support for legacy character decoders that aren’t really necessary for supporting existing Web content.</blockquote>

  • I am using iPad1. Running v4.3 and when connecting to wifi iPad keyboard does not work. Keyboard works for everything else including typing this question out. Why would it not work when typingin password for wifi connection?

    I am using iPad1. Running v4.3 and when connecting to wifi iPad keyboard does not work. Keyboard works for everything else including typing this question out. Why would it not work when typingin password for wifi connection?

    Kowhai wrote:
    Lots of WIFI needs a username and password to get access. I guess you're lucky and yours is set up unsecured.
    Normal secured WiFi requires only a password to get access. The password is used to encrypt traffic between your device and the WiFi access point. If whatever you are using requires a username as well then it is not simply normal secured WiFi. It might be a subscription WiFi service like GOGO, ATT, etc., or a service with authentication, i.e., college campus, etc. To help you out we need to know what you are using and what connection dialog you are being presented with. You don't have exactly the same problem as the original poster. He is having a problem entering a password into the password dialog that iOS presents when one tries to connect to a normal secured WiFi network. Could you clarify exactly which WiFi service you are using.

  • What can I do for the following situation: I think my insert slot for the headphones does not work; when I put in any cable that should and can go in all I hear is low frequent static sounds.

    What can I do for the following situation: I think my insert slot for the headphones does not work; when I put in any cable that should and can go in all I hear is low frequent static sounds.

    You might try talking to the Apple store manager and see if you don't get more help...you might also contact Apple.com/support and see if they can give you a contact with the Apple Italy offices.
    Sounds like you have two levels of failure, the first shop that did the repair and broke a wire, and the second that has disabled something else and isn't helping.
    Apple officially refurbished equipment is usually good quality.  Surprising this has happened but you need to press on with complaints and try for resolution.

  • Home page link on desktop Facebook still does not work (pic included)

    This does NOT happen in other mobile browsers, only Firefox. Over many Firefox versions on Android, the home link in top left corner of facebook does nothing when tapped/clicked. Same as the "Home" button on the top right. If I click the Facebook button 23 - 30 times, THEN it will load the newsfeed....otherwise it just sits there doing nothing. See the attached image below. What is circled in RED is what does NOT work. Mostly I have to open the link bar and type in the facebook address to load it. Why is this?

    I've had this problem since Firefox V.17.0. it bugs having to open the link bar just to have to go to my newsfeed. Mobile site sucks :p

  • HT1338 my software update does not work using OS X 10.6.8: update icon just stays static and times out, although web is online

    My software update does not work: the icon jams and then times out, although web is online. How to resolve??

    Snow Leopard DVD:
    You can get it only by phone now from Apple.
    In the US, call 1-800-MY-APPLE and ask for a sales assistant. Last quoted price was $19.99 for the single-user and $29.99 for the family licence.
    For other countries, check here; http://support.apple.com/kb/HE57
    Don't forget to ask for Sales; the tech support guys can't help.
    When you've installed SL it will be 10.6.3. You need to update that to 10.6.8 with the combo installer from http://support.apple.com/kb/DL1399 - that gives you access to the Mac App store.
    Lion is only available by phone also - same number and they'll give you a download code to use in the Mac App Store.
    If you're going to Mountain Lion you don't need to install Lion first - you can do it straight from Snow Leopard 10.6.8.
    Specifications;
    Snow Leopard 10.6.x:
    Lion 10.7.x;
    Mountain Lion 10.8.x:
    As for Lion, but also must be one of these groups;
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminium, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    Xserve (Early 2009)
    <sorry to repeat, guys, but following links isn't always a given with OPs>

  • Enforcing JRE version for Applet does not work - 1.4.2

    Hi,
    Our application (Applet) requires JRE 1.4.2 .
    I believe I need to use STATIC VERSIONING as we want the client desktop to ONLY use 1.4.2 for our applet.
    So I followed the instructions mentioned in
    http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-ie
    and
    http://java.sun.com/products/plugin/versions.html
    But for some reason the JAVA Installer fails to install the package.
    It comes back with this pop-up error message:
    Error - Java(TM) Installer
    Unable to download http://java.sun.com/update/1.4.2/1.4.2-b28.xml for installation
    Here is the jsp code snippet:
    <center>
    <OBJECT classid="clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA" id="myapplet" NAME="myapplet"
        width="650" height="426" border="1" align="baseline"
        codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0">
        <PARAM name="code" value="com.statestreet.gia.ui.applet.ComponentApplet">
        <PARAM name="codebase" value="/jars">
        <PARAM name="type" value="application/x-java-applet;jpi-version=1.4.2">
        <PARAM NAME="cache_option" VALUE="Plugin">
        <PARAM NAME="cache_archive" VALUE="jar1.jar,jar2.jar">
        <PARAM name="scriptable" value="true">
        <PARAM NAME="mayscript" VALUE ="true">
       <center>
        <P>This page requires the Java Runtime Environment Plug-in. If you see this message,
        the automatic install probably failed. <BR>Please <A href="http://java.sun.com/j2se/1.4.2/download.html">click here
    </A>
        to manually install the environment. If prompted, please choose "Run this file from its current location" or "Open"
    .<BR>
        Accept all of the defaults during the installation. When the installation completes, please click the refresh butto
    n on your browser. <BR>
        If this process does not work, please contact the Help Desk.
        </P>
        </center>
    </OBJECT>
    </center>I have tried changing the codebase by removing the "#Version part.." but still no result.
    Any suggestion is greatly appreciated.
    thanks
    hp

    Yeah, after hours of searching it must be so that my son has a 8GB i.e. a 2G version and mine just happens to be the 3G as I bought mine a month later....did not know how to know the difference but now solved, thnx.

  • This.print(pp) with interactive type silent or automatic does not work  after upgrade acrobat reader 9 to acrobat reader 11

    After an upgrade of acrobat reader 9 to acrobat reader 11 the automatic printing of a pdf. The pdf is opened, but the print does not happen. With acrobat reader 9 it works. But with acrobat reader 11 the printing does not happen.
    I discovered when you specify pp.constants.interactionLevel.full it works on acrobat reader 11. But when you specify pp.constants.interactionLevel.silent or pp.constants.interactionLevel.automatic it does not work on acrobat reader 11. But with the full option we have a dialog  print box
    we do not want.
    In our jsp we load a pdf document and create a message handler to detect the print events of a pdf document that is in an <object> tag.
    In the pdf document we add
    package be.post.lpo.util;
    import org.apache.commons.lang.StringEscapeUtils;
    import org.apache.commons.lang.StringUtils;
    public class AcrobatJavascriptUtil {  
        public String getPostMessageToHostContainer(String messageName, String messageBody){
            return "var aMessage=['"+messageName+ "', '"+ messageBody+"'];this.hostContainer.postMessage(aMessage);";
        public String getAutoPrintJavaScript(String interactiveType, String printerName,String duplexType) {    
            String interactiveTypeCommand = "";
            if (StringUtils.isNotBlank(interactiveType)){
                interactiveTypeCommand = "pp.interactive = " + interactiveType + ";";
            String duplexTypeCommand = "";
            if (StringUtils.isNotBlank(duplexType)){
                duplexTypeCommand = "pp.DuplexType = " + duplexType + ";";
            return "" + // //
                    "var pp = this.getPrintParams();" + // //
                    // Nointeraction at all dialog, progress, cancel) //
                    interactiveTypeCommand + //
                    // Always print to a printer (not to a file) //
                    "pp.printerName = \"" + StringEscapeUtils.escapeJavaScript(printerName) + "\";" + //
                    // Never print to a file. //
                    "pp.fileName = \"\";" + //
                    // Print images using 600 DPI. This option MUST be set or some barcodes cannot //
                    // be scanned anymore. //
                    "pp.bitmapDPI = 600;" + //
                    // Do not perform any page scaling //
                    "pp.pageHandling = pp.constants.handling.none;" + //
                    // Always print all pages //
                    "pp.pageSubset = pp.constants.subsets.all;" + //
                    // Do not autocenter //
                    "pp.flags |= pp.constants.flagValues.suppressCenter;" + //
                    // Do not autorotate //
                    "pp.flags |= pp.constants.flagValues.suppressRotate;" + //
                    // Disable setPageSize i.e. do not choose paper tray by PDF page size //
                    "pp.flags &= ~pp.constants.flagValues.setPageSize;" + //
                    // Emit the document contents. Document comments are not printed //
                    "pp.printContent = pp.constants.printContents.doc;" + //
                    // printing duplex mode to simplex, duplex long edge, or duplex short edge feed //
                    duplexTypeCommand +
                    // Print pages in the normal order. //
                    "pp.reversePages = false;" + //
                    // Do the actual printing //
                    "this.print(pp);";
    snippets for java code that adds
    package be.post.lpo.util;
    import org.apache.commons.lang.StringUtils;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.pdf.PdfAction;
    import com.lowagie.text.pdf.PdfDestination;
    import com.lowagie.text.pdf.PdfImportedPage;
    import com.lowagie.text.pdf.PdfName;
    import com.lowagie.text.pdf.PdfReader;
    import com.lowagie.text.pdf.PdfWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    public class PdfMergerUtil{
        private static final PdfName DID_PRINT = PdfName.DP;
        private static final PdfName WILL_PRINT = PdfName.WP;
        private List<PdfActionJavaScriptHolder> actionJavaScripts = new ArrayList<PdfActionJavaScriptHolder>();
        private class PdfActionJavaScriptHolder{
            private final PdfName actionType;
            private final String javaScript;
            public PdfActionJavaScriptHolder(PdfName actionType, String javaScript) {
                super();
                this.actionType = actionType;
                this.javaScript = javaScript;
            public PdfName getActionType(){
                return this.actionType;
            public String getJavaScript(){
                return this.javaScript;
        public void writePdfs(OutputStream outputStream, List<InputStream> documents, String documentLevelJavaScript) throws Exception {
            Document document = new Document();
            try {          
              // Create a writer for the outputstream
              PdfWriter writer = PdfWriter.getInstance(document, outputStream);
              document.open();      
              // Create Readers for the pdfs.
              Iterator<PdfReader> iteratorPDFReader = getPdfReaders(documents.iterator());
              writePdfReaders(document, writer, iteratorPDFReader);
              if (StringUtils.isNotBlank(documentLevelJavaScript)){
                  writer.addJavaScript(documentLevelJavaScript);
              addAdditionalActions(writer);
              outputStream.flush();      
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            } finally {
                if (document.isOpen()){
                    document.close();
                try {
                    if (outputStream != null){
                        outputStream.close();
                } catch (IOException ioe) {
                    ioe.printStackTrace();
                    throw ioe;
        public void addAdditionalDidPrintAction(String javaScript){
            actionJavaScripts.add(new PdfActionJavaScriptHolder(DID_PRINT, javaScript));   
        public void addAdditionalWillPrintAction(String javaScript){
            actionJavaScripts.add(new PdfActionJavaScriptHolder(WILL_PRINT, javaScript));   
        private void writePdfReaders(Document document, PdfWriter writer,
                Iterator<PdfReader> iteratorPDFReader) {
            int pageOfCurrentReaderPDF = 0;      
              // Loop through the PDF files and add to the output.
              while (iteratorPDFReader.hasNext()) {
                PdfReader pdfReader = iteratorPDFReader.next();
                // Create a new page in the target for each source page.
                while (pageOfCurrentReaderPDF < pdfReader.getNumberOfPages()) {
                  document.newPage();
                  pageOfCurrentReaderPDF++;          
                  PdfImportedPage page = writer.getImportedPage(pdfReader, pageOfCurrentReaderPDF);
                  writer.getDirectContent().addTemplate(page, 0, 0);          
                pageOfCurrentReaderPDF = 0;
        private void addAdditionalActions(PdfWriter writer) throws DocumentException{
            if (actionJavaScripts.size() != 0 ){
                PdfAction action = PdfAction.gotoLocalPage(1, new PdfDestination(PdfDestination.FIT), writer);
                writer.setOpenAction(action);
                for (PdfActionJavaScriptHolder pdfAction : actionJavaScripts ){
                    if (StringUtils.isNotBlank(pdfAction.getJavaScript())){
                        action = PdfAction.javaScript(pdfAction.getJavaScript(), writer);
                        writer.setAdditionalAction(pdfAction.getActionType(), action);
        private Iterator<PdfReader> getPdfReaders(Iterator<InputStream> iteratorPDFs) throws IOException {
            List<PdfReader> readers = new ArrayList<PdfReader>();
              while (iteratorPDFs.hasNext()) {
                InputStream pdf = iteratorPDFs.next();
                PdfReader pdfReader = new PdfReader(pdf);
                readers.add(pdfReader);        
            return readers.iterator();
    JSP code
    <script type="text/javascript" src="<bean:message key="scripts.js.internal.jquery" bundle="app"/>"></script>
        <script language="javascript">
        function goToDidPrintUrl(){
            var url = "<%=didPrintUrl%>";
            window.location.assign(url);
        function createMessageHandler() {
            var PDFObject = document.getElementById("myPdf");
            PDFObject.messageHandler = {
                onMessage: function(msg) {
                     if (msg[0] == "WILL_PRINT"){      
                        $("#printingTransitFeedBackMessage").text('<%=willPrintMessage%>');                   
                     if(msg[0] == "DID_PRINT"){
                        $("#printingTransitFeedBackMessage").text('<%=didPrintMessage%>');               
                        setTimeout('goToDidPrintUrl()',4000);
                onError: function(error, msg) {
                    alert(error.message);
        </script>
    </head>
    <body onLoad="createMessageHandler();">
    <div id="printingTransitFeedbackArea">
      <div class="info" id="printingTransitFeedBackMessage"><%=documentOpenMessage%></div>
    </div>
    <object id="myPdf" type="application/pdf" width="100%" height="100%"  data="<%=toBePrintedUrl%>">
    </object>
    </body>

    From the JS API Reference of the print method:
    Non-interactive printing can only be executed during batch, console, and menu
    events.
    Outside of batch, console, and menu events, the values of bUI and of interactive are ignored
    and a print dialog box will always be presented.

Maybe you are looking for