Viewing word office document in java applet inside firefox -


I am trying to see a .doc / .docx Microsoft Word files in the webpage on Firefox. When everything was unsuccessful then I tried to make an applet which would be an example of Word OLE to look at the document.

I created the applet using: org.eclipse.swt.ole.win32.OleClientSite, and in Eclipse it works fine and I can see the word inside.

I have created a .jar file and I tried to use the applet inside the webpage in Firefox. The applet starts but I can not see anything inside.

This is my applet code:

  import java.applet.Applet; The public-grade ZWWEVER applet {org.eclipse.swt.widgets.Display Expands Expand; Org.eclipse.swt.widgets.Shell swtParent; Java.awt.Canvas awtParent; Public Zero Init (Thread Threads = New Thread (New Runnabal) (Public Zero Run) {setLayout (New JavaA.te. Grid Layout (1, 1)); ATP = New Java Quote (awtParent) display = new org.eclipse.swt.widgets.Display (); swtParent = org.eclipse.swt.awt.SWT_AWT.new_Shell (performance, awtParent); swtParent.setLayout (new org.eclipse.swt.layout .FillLayout ( )); org.eclipse.swt.ole.win32.OleFrame frame = new org.eclipse.swt.ole.win32.OleFrame (swtParent, org.eclipse.swt.SWT.NONE); org.eclipse.swt .ole. win32.OleClientSite site; try {site = new org.eclipse.swt.ole.win32.OleClientSite (frame, org.eclipse.swt.SWT.NONE, "Word.Document");} catch (org.eclipse .swt. SWTException e) {string str = "ol EClientSite error "+ e.toString (); System.out.println (str); return;} setSize (500, 500); valid (); site.doVerb (org.eclipse.swt.ole.win32.OLE. OLEIVERB_SHOW); while (swtParent! = Null & SwtParent.isDisposed ()) {if (! Display.readAndDispatch ()) display.sleep ();}}}); Thread.start (); } Public zero-stop (if (display! = Tap & amp;; display.isDisposed ()) {display.syncExec} {Public runs zero () (if (swtParent! = Null &! SwtParent. IsDisposed ()) swtParent.dispose (); swtParent = null; display.dispose (); display = null;}}); deleting (awtParent); AwtParent = null;  

Any idea why this is not working?

The Java console says:

basic: on JWordViewer (Display.java:130); pointed customers applet org On junk.lang.exceptionInInitializerError exception has started in the thread "Thread-11" at eclipse.swt.widgets.Display that & lt; clinit & gt; java.security.AccessContro LException: $ 1.run due to Java.lang.Thread.run (Unknown Source) (JWordViewer.java.1) denied access to Java (reading java.util.PropertyPermission sun.arch.data.model). on SecuritykAccessControlContextkcheckPermission (unknown source) JavaksecuritykAccessControllerkcheckPermission (unknown source java.lang.SecurityManager.checkPermission on java.lang.SecurityManager.checkPropertyAccess on Javaklang) (unknown source) (unknown source). system.getProperty (Unknown Source org.eclipse.swt.internal.Library.loadLibrary (library.java.11) on Library.loadLibrary (Library.java167) on Org.eclipse.swt.internal) Se.swt on org.eclip .internal.C & Lt; Clinit & gt; (Sejwa 21) ... 3 more

And after that I asked to believe this applet ...

Here is the answer: it requires permission to read and execute on disk. One option is to sign the .jar file and the second option is to allow disk.

I used to test the second option: I modified the java.policy file like this: `codebase grant '' 'permission java.io.FilePermission' & lt;>" , "Read, write, execute, delete"; permission java.net.SocketPermission "", "accept, connect, listen, solve"; permission java.util.PropertyPermission "", "read, Write "permission java.lang.RuntimePermission" * "; allow java.awt.AWTPermission" showWindowWithoutWarningBanner ";};

and fix it.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -