aspose file tools*
The moose likes Applets and the fly likes Exception related to JDIC. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Exception related to JDIC." Watch "Exception related to JDIC." New topic
Author

Exception related to JDIC.

Makesh Kumar Ramakrishnan
Ranch Hand

Joined: Jan 07, 2006
Posts: 88
In my applet application, I am trying to use JDIC to launch a new Internet Browser with dynamically generated HTML. I have successfully used JDIC in my swing version of the same application. I am converting that swing application to an applet application. I am getting the following error while launching the Browser window. Please let me know the solution for this. Is there any other better solution to display the dynamically generated HTML in Internet Browser? I tried to JSObject of JAWS.jar. But It didn't work.. I am getting some exception there. Please help me to get rid of this major hurdle? I appreciate your help.

Please visit this thread which discuss about the same problem

Java.net Forums






Thanks,


Makesh<br /> <br />SCJP | SCWCD | SCBCD | SCEA
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41571
    
  54
Not sure if this is the problem, but JDIC includes native libraries, so it's not going to work in applets. The last entry on the JavaIntermediateFaq points to 2 libraries that can launch browser in a cross-platform way. Note that the applet needs to signed (or the local security policy altered) for this to work.


Ping & DNS - my free Android networking tools app
Makesh Kumar Ramakrishnan
Ranch Hand

Joined: Jan 07, 2006
Posts: 88
Thank you for your information. I checked the two projects, you mentioned. After going thro the documentation, my guess is those two projects just launch the Browser with the given URL.Please correct me if i am wrong. I want to display the dynamically generated content in the newly launched browser. I don't want to write the html file to the local disk for the Obvious reasons.

For your information, I am using JDIC with signed jars(including native jars) and also I changed my local policy file.

Do you have any idea about JSObject of JAWS.jar( provided by netscape)?

Thanks,
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41571
    
  54
my guess is those two projects just launch the Browser with the given URL.

That's correct.


I want to display the dynamically generated content in the newly launched browser.

How is that different from opening the URL in a browser? Or are you saying that the applet is generating HTML and wants to display that in the new browser instance? If so, you might be able to use the JEditorPane as kind of a built-in browser. It can display HTML 3.2, but no CSS, JavaScript, applets, Flash and so forth.

I don't want to write the html file to the local disk for the Obvious reasons.

The browser doesn't care where it's a file:/// URL or a http:// URL, and neither would the library that opens the browser.

For your information, I am using JDIC with signed jars(including native jars) and also I changed my local policy file.

Applets can't install native components, no matter how they're packaged.

Do you have any idea about JSObject of JAWS.jar( provided by netscape)?

The class is used for applet<-->JavaScript communication); some info is here. If you can assume that this kind of communication works (not a given for any particular browser/Java Plugin/OS combination), then you may be able to use it to transfer the dynamically created HTML into the browser.
[ April 19, 2007: Message edited by: Ulf Dittmer ]
Makesh Kumar Ramakrishnan
Ranch Hand

Joined: Jan 07, 2006
Posts: 88
How is that different from opening the URL in a browser? Or are you saying that the applet is generating HTML and wants to display that in the new browser instance? If so, you might be able to use the JEditorPane as kind of a built-in browser. It can display HTML 3.2, but no CSS, JavaScript, applets, Flash and so forth.
The HTML is genearted by XSL Transformer using XSL and XML documents. Thats for reporting purpose. So It includes CSS scripts. So I can't use JEditorpane to display the HTML as It doesn't support CSS.


The browser doesn't care where it's a file:/// URL or a http:// URL, and neither would the library that opens the browser.

The report is going to be large file. So I want to avoid the file writing and reading operation time.


Applets can't install native components, no matter how they're packaged.
Does it mean that I can't use JDIC in my applet application.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41571
    
  54
So I want to avoid the file writing and reading operation time.

I don't think you can.

Does it mean that I can't use JDIC in my applet application.

Yes, that's what I said in my first post.
Makesh Kumar Ramakrishnan
Ranch Hand

Joined: Jan 07, 2006
Posts: 88
Thank you Ulf for your timely help.


Thanks,
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Applets can't install native components, no matter how they're packaged.


Not true. We are doing it in a very popular web application for the company I work for. We simply jar up the native libs and load them in init. Of course the Applet is signed so we have permission to muck with the local system.

There are other ways to do it too. The particular problem here is not that you can't run native libs but there seems to be a problem with some JREs and JDIC. For example I am using Web Start to do something similar and everything works fine in the 1.5.0_08 JRE but I get the same problem mentioned with any 1.6 JRE. The tray libs work fine but the embedded browser chokes.

Take a look at this article on packaging JDIC in an Applet or Web Start application:

JDIC Application Deployment
[ May 27, 2007: Message edited by: Michael Morris ]

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
Consider Paul's rocket mass heater.
 
subject: Exception related to JDIC.