exec in same frame not in new browser ?

P

pcouas

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
 
M

Matt Humphrey

pcouas said:
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 (e-mail address removed) http://www.iviz.com/
 
P

pcouas

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
 
M

Matt Humphrey

pcouas said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top