exec in same frame not in new browser ?

Discussion in 'Java' started by pcouas, Jun 6, 2006.

  1. pcouas

    pcouas Guest

    Hi,

    Could i launch browser with command
    Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler
    "+filePath) without launching new Browser, but in same Browser ???

    I don't use ShowDocument, because Tomcat webserver launch PDF on local
    PC file://D:/toto.pdf

    Regards
    Philippe
    pcouas, Jun 6, 2006
    #1
    1. Advertising

  2. "pcouas" <> wrote in message
    news:...
    > Hi,
    >
    > Could i launch browser with command
    > Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler
    > "+filePath) without launching new Browser, but in same Browser ???
    >
    > I don't use ShowDocument, because Tomcat webserver launch PDF on local
    > PC file://D:/toto.pdf
    >


    There's a good Javatip for this at
    http://www.javaworld.com/javaworld/javatips/jw-javatip66.html

    It says that it will open the document in the default browser without having
    to open a new window, as does this discussion
    http://www.codecomments.com/archive256-2004-7-235674.html . However, I
    found that even when I set the IE Tools /Internet Options/Advanced/Reuse
    shortcuts flag, file-based URLs would continue to open in new windows
    whereas http:-based URLs would reuse a window. This is really a Windows
    issue rather than a Java issue. This site lists rundll options, but there
    aren't any for window control like _blank.
    http://www.ericphelps.com/batch/rundll/ There are other sites out there that
    have more complex details, try googling on rundll32 fileprotocolhandler

    In any case, you ask about using this in preference to showDocument, which I
    normally think of as an applet request. The exec method will not work from
    an applet unless you sign the applet and have the user grant permission.

    Cheers,
    Matt Humphrey http://www.iviz.com/
    Matt Humphrey, Jun 8, 2006
    #2
    1. Advertising

  3. pcouas

    pcouas Guest

    Hi

    My Applet is signed with keytool and jarsigner but
    this.getAppletContext().showDocument(new
    java.net.URL("file://D:/temp2/aaa.pdf"),"_top");
    or
    this.getAppletContext().showDocument(new
    java.net.URL("file://localhost/D:/temp2/aaa.pdf"),"_top");

    Don't give me any result and no error, perhaps my problem is with
    grant, i haven't giving special grant, Where could i found
    documentation and allow my applet itself has right ?

    Regards
    Philippe
    pcouas, Jun 8, 2006
    #3
  4. "pcouas" <> wrote in message
    news:...
    > Hi
    >
    > My Applet is signed with keytool and jarsigner but
    > this.getAppletContext().showDocument(new
    > java.net.URL("file://D:/temp2/aaa.pdf"),"_top");
    > or
    > this.getAppletContext().showDocument(new
    > java.net.URL("file://localhost/D:/temp2/aaa.pdf"),"_top");
    >
    > Don't give me any result and no error, perhaps my problem is with
    > grant, i haven't giving special grant, Where could i found
    > documentation and allow my applet itself has right ?


    showDocument is no longer reliable and many popup-blockers disable it.
    There is a report of some difficulty here for IE 6 in that applets must be
    in the Intranet / Trusted zone in order for showDocument to work.
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4816478

    Also look at
    https://cis.med.ucalgary.ca/http/forum.java.sun.com/thread.jspa?threadID=557141&messageID=2732787

    And here
    https://cis.med.ucalgary.ca/http/forum.java.sun.com/thread.jspa?threadID=587905&tstart=120

    I've not worked with setting applet permissions, which you will likely need
    because you're reading local files. I'm not sure why it's not working for
    you.

    Cheers,
    Matt Humphrey
    Matt Humphrey, Jun 8, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hal Vaughan
    Replies:
    11
    Views:
    1,081
    Gordon Beaton
    May 22, 2006
  2. tedsuzman
    Replies:
    2
    Views:
    7,055
    Michel Claveau, résurectionné d'outre-bombe inform
    Jul 21, 2004
  3. Ted
    Replies:
    1
    Views:
    448
    Duncan Booth
    Jul 22, 2004
  4. Guillermo Riojas
    Replies:
    0
    Views:
    154
    Guillermo Riojas
    Nov 26, 2010
  5. Random Task
    Replies:
    12
    Views:
    629
    Joe Smith
    Dec 4, 2005
Loading...

Share This Page