Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » cross scripting issues - can RAP serve HTML documents?
cross scripting issues - can RAP serve HTML documents? [message #111489] Thu, 06 November 2008 16:50 Go to next message
Alex is currently offline AlexFriend
Messages: 3
Registered: July 2009
Junior Member
Hello,
I need to access the elements of an HTML page which is embedded in a
custom widget using a qx.ui.embed.Iframe

Currently the embedded HTML page is served by an apache running on
localhost:80, while RAP is running on localhost:9090. If I understood
correctly, security measures restrict the Iframe object from modifying the
embedded contents or executing javascript, because they come from a
different server.

My simple question is, what is necessary to serve the embedded document
(up to now http://localhost/tmp/test.html) from the RAP server, for
example at http://localhost:9090/resources/test.html?

My guess was that I have to define an extension at point
org.eclipse.rap.ui.resources with a class that implements
org.eclipse.rwt.resources.IResource. However defining "public String
getLocation() { return "resources/test.html"; }" in that class doesn't
serve the file (resource/test.html in the project tree) at
http://localhost:9090/resources/test.html. What is wrong?

Thank you
Alex
Re: cross scripting issues - can RAP serve HTML documents? [message #111530 is a reply to message #111489] Thu, 06 November 2008 18:31 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi Alex,

you can use the extension point
"org.eclipse.equinox.http.registry.resources" to specify a directory
with your html-files. The field "alias" would be "/resources" (same as
in URL), the field "base-name" must point the location in your bundle,
where these html-files are (e.g. "/html").

Hope that helps,
Stefan.


Alex schrieb:
> Hello,
> I need to access the elements of an HTML page which is embedded in a
> custom widget using a qx.ui.embed.Iframe
>
> Currently the embedded HTML page is served by an apache running on
> localhost:80, while RAP is running on localhost:9090. If I understood
> correctly, security measures restrict the Iframe object from modifying
> the embedded contents or executing javascript, because they come from a
> different server.
> My simple question is, what is necessary to serve the embedded document
> (up to now http://localhost/tmp/test.html) from the RAP server, for
> example at http://localhost:9090/resources/test.html?
>
> My guess was that I have to define an extension at point
> org.eclipse.rap.ui.resources with a class that implements
> org.eclipse.rwt.resources.IResource. However defining "public String
> getLocation() { return "resources/test.html"; }" in that class doesn't
> serve the file (resource/test.html in the project tree) at
> http://localhost:9090/resources/test.html. What is wrong?
>
> Thank you
> Alex
>
Re: cross scripting issues - can RAP serve HTML documents? [message #111543 is a reply to message #111530] Thu, 06 November 2008 19:55 Go to previous messageGo to next message
Alex is currently offline AlexFriend
Messages: 3
Registered: July 2009
Junior Member
Thank you Stefan,
I think this is exactly what I'm looking for. However, I'm using the the
jetty server (this is the default, isn't it?) not the equinox http server.
Nevertheless I followed your suggestion, but accessing the test page
leaves a blank page (no background image, no error message). Is the
org.eclipse.equinox.http.registry.resources extension point supposed to
work with the jetty server, or is there another solution for jetty, or do
I have to configure RAP to use the equinox server (how)?

Thanks
Alex

Stefan Roeck wrote:

> Hi Alex,

> you can use the extension point
> "org.eclipse.equinox.http.registry.resources" to specify a directory
> with your html-files. The field "alias" would be "/resources" (same as
> in URL), the field "base-name" must point the location in your bundle,
> where these html-files are (e.g. "/html").

> Hope that helps,
> Stefan.
Re: cross scripting issues - can RAP serve HTML documents? [message #111556 is a reply to message #111530] Thu, 06 November 2008 21:21 Go to previous message
Alex is currently offline AlexFriend
Messages: 3
Registered: July 2009
Junior Member
It works as you wrote. First I inserted some typos which caused troubles,
but now it's fine.

Thank you
Alex

Stefan Roeck wrote:

> Hi Alex,

> you can use the extension point
> "org.eclipse.equinox.http.registry.resources" to specify a directory
> with your html-files. The field "alias" would be "/resources" (same as
> in URL), the field "base-name" must point the location in your bundle,
> where these html-files are (e.g. "/html").

> Hope that helps,
> Stefan.
Previous Topic:RAP 1.2 M2 target platform package, wrong content??
Next Topic:Changing tree node image when expanding/collapsing
Goto Forum:
  


Current Time: Wed Mar 29 20:58:13 GMT 2023

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

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

Back to the top