Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » ExternalBrowser "file:///" url problem
ExternalBrowser "file:///" url problem [message #66534] Fri, 14 December 2007 16:14 Go to next message
Eclipse UserFriend
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.
Re: ExternalBrowser "file:///" url problem [message #66577 is a reply to message #66534] Fri, 14 December 2007 18:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

i solved the problem by using a custom dialog an a browser widget which is
a much better solution, i dont need to use the file. but the question
remains is this could be a bug :P
Re: ExternalBrowser "file:///" url problem [message #66774 is a reply to message #66577] Sun, 16 December 2007 23:37 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 237
Registered: July 2009
Senior Member
Hi,

I don't know what's the root of the problem but maybe you could file a
bug so we can track this issue.

Greets
Benny

Ben W. wrote:
> i solved the problem by using a custom dialog an a browser widget which
> is a much better solution, i dont need to use the file. but the question
> remains is this could be a bug :P
>
Re: ExternalBrowser "file:///" url problem [message #66953 is a reply to message #66774] Mon, 17 December 2007 20:07 Go to previous message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

i filed a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=213213
Previous Topic:Section setTitleBarBackground
Next Topic:browser widget
Goto Forum:
  


Current Time: Thu Apr 25 22:55:55 GMT 2024

Powered by FUDForum. Page generated in 0.03685 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top