ExternalBrowser "file:///" url problem [message #66534] |
Fri, 14 December 2007 11:14  |
Eclipse User |
|
|
|
Originally posted by: benjamin.wolff.web.de
hi!
i have a multi text widget where the user may enter html code.
there is a preview button which is supposed to show a preview of this html
code, the code of the method which is called in the listener looks like
this:
public void vorschauEmail() {
int style = 0;
try {
File tempFile = File.createTempFile("emailvorschau", ".html");
FileWriter fw;
BufferedWriter bw;
fw = new FileWriter(tempFile);
bw = new BufferedWriter(fw);
bw.write(view.emailtextText.getText());
bw.close();
String filename = "file:///" + tempFile.getAbsolutePath();
ExternalBrowser.open("externalBrowser", filename, style);
} catch (IOException e) {
e.printStackTrace();
}
}
the tempfile is created and exists in the local temp folder of the user.
when i call the method the following error occurs:
Could not evaluate javascript response:
[Exception... "Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [nsIDOMJSWindow.open]" nsresult: "0x80004005
(NS_ERROR_FAILURE)" location: "JS frame ::
http://127.0.0.1:9080/katalog?startup=admin :: anonymous :: line 7438"
data: no]
org.eclipse.swt.EventUtil.suspendEventHandling();var req =
org.eclipse.swt.Request.getInstance();req.setRequestCounter( "6" );var wm
= org.eclipse.swt.WidgetManager.getInstance();var w = wm.findWidgetById(
"w4" );w.setSpace( 0, 1278, 0, 20
);qx.ui.core.Widget.flushGlobalQueues();org.eclipse.swt.Even tUtil.resumeEventHandling();org.eclipse.rwt.widgets.External Browser.open(
"_______________",
" file:///C:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\emailvorschau5904 .html",
" dependent=1,scrollbars=1,resizable=1,status=0,location=0,too lbar=0,menubar=0 "
);
when i remove the "file:///" then there is no error, but the browser says
the doesn't know how to open the link.
System.out.println(tempFile.getAbsolutePath()); <- prints
C:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\emailvorschau5904.html
if this a bug or a wanted security issue?
mfg
-ben w.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.13560 seconds