Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Browser.setUrl(Str) does not work with local files(Browser.setUrl(Str) does not work with local files)
Browser.setUrl(Str) does not work with local files [message #525013] Mon, 05 April 2010 10:43 Go to next message
Farooq Kamal is currently offline Farooq KamalFriend
Messages: 40
Registered: January 2010
Location: Karachi, Pakistan
Member
On contrary to SWT, Browser.setUrl(Str) does not work with local file URLS (file:///C.... ). I need to display a html file generated by jasper reports but the browser does not seem to accept the file:/// url. I have tried all options (e.g. without file: , with \\ etc) and checked all the security issues. The method returns true even if i specify a wrong path. The result is always a blank / nothing page.

I added a location listener which correctly passes the url in the event.

Any ideas?
Re: Browser.setUrl(Str) does not work with local files [message #525288 is a reply to message #525013] Tue, 06 April 2010 06:15 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi, you can register the generated file(s) as resources at the
HttpService and then pass a relative URL to the Browser widget.

Regards,
Stefan.

Farooq Kamal schrieb:
> On contrary to SWT, Browser.setUrl(Str) does not work with local file
> URLS (file:///C... ). I need to display a html file generated by jasper
> reports but the browser does not seem to accept the file:/// url. I have
> tried all options (e.g. without file: , with \\ etc) and checked all the
> security issues. The method returns true even if i specify a wrong path.
> The result is always a blank / nothing page.
>
> I added a location listener which correctly passes the url in the event.
>
> Any ideas?
Re: Browser.setUrl(Str) does not work with local files [message #525310 is a reply to message #525013] Tue, 06 April 2010 07:56 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi,

file URLs do not work for a good reason. A website is not allowed to
access resources from the client's file system. If you're trying to
access a file on the server, you need to make it available via HTTP, as
Stefan suggested.

Best regards, Ralf

Farooq Kamal wrote:
> On contrary to SWT, Browser.setUrl(Str) does not work with local file
> URLS (file:///C... ). I need to display a html file generated by jasper
> reports but the browser does not seem to accept the file:/// url. I have
> tried all options (e.g. without file: , with \\ etc) and checked all the
> security issues. The method returns true even if i specify a wrong path.
> The result is always a blank / nothing page.
>
> I added a location listener which correctly passes the url in the event.
>
> Any ideas?
Previous Topic:Question about some proposed features' plan in RAP 1.3
Next Topic:[ANN] Slides from my EclipseCon Talk are Available
Goto Forum:
  


Current Time: Wed Apr 24 22:33:32 GMT 2024

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

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

Back to the top