Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

exec in same frame not in new browser ?

Thread view: 
pcouas - 06 Jun 2006 17:19 GMT
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
Matt Humphrey - 08 Jun 2006 01:51 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.