> Hi,
>
[quoted text clipped - 4 lines]
> 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 matth@ivizNOSPAM.com http://www.iviz.com/
pcouas - 08 Jun 2006 09:47 GMT
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
Matt Humphrey - 08 Jun 2006 12:39 GMT
> Hi
>
[quoted text clipped - 8 lines]
> 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