Loading local html in browser widget [message #1122513] |
Tue, 01 October 2013 16:59 |
Julia Kurde Messages: 91 Registered: November 2011 Location: Berlin, Germany |
Member |
|
|
Hi,
Is it possible to load an html file which is located in a plugin folder within the RAP?
I can get the server url and the context path of the application but then, how does it continue? Let's say the file is in the plugin [eub.jlzhtools] in folder [js/].
So, serverUrl + contextPath + pluginName + folderName + fileName =
http://127.0.0.1:50787/jLZHweb/eub.jlzhtools/js/chart.html
This leads to the error [ERR_TOO_MANY_REDIRECTS]
(A HttpServlet is registered to redirect to a welcome page)
Inserting also the servlet path [/web]
http://127.0.0.1:50787/jLZHweb/web/eub.jlzhtools/js/chart.html
leads to [HTTP ERROR: 404 Not Found]
Is it possible to access the file like this and, if yes,
how do I get the correct URL for it?
Thanks and regards, Julia
PS: I guess I have to register the file as resource, but somehow,
Thread.currentThread().getContextClassLoader().getResourceAsStream("js/chart.html");
always returns null, although the [js] folder is on the class path. Actually, how to check that? I thought it needs to be included the project's [bin] folder, which is defined in the build.properties file:
bin.includes = jlzhtools.jar,\
META-INF/,\
js/
[Updated on: Tue, 01 October 2013 17:59] Report message to a moderator
|
|
|
Re: Loading local html in browser widget [message #1122559 is a reply to message #1122513] |
Tue, 01 October 2013 17:59 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Julia,
you have to register the html as resource and get its path from the
resource manager - see MarkupExample#|registerImage|.
[ 1]
http://git.eclipse.org/c/rap/org.eclipse.rap.git/tree/examples/org.eclipse.rap.examples.pages/src/org/eclipse/rap/examples/pages/MarkupExample.java
HTH,
Ivan
On 10/1/2013 7:59 PM, Julia Kurde wrote:
> Hi,
>
> Is it possible to load an html file which is located in a plugin
> folder within the RAP?
>
> I can get the server url and the context path of the application but
> then, how does it continue? Let's say the file is in the plugin
> [eub.jlzhtools] in folder [js/].
>
> So, serverUrl + contextPath + pluginName + folderName + fileName =
> http://127.0.0.1:50787/jLZHweb/eub.jlzhtools/js/chart.html
>
> This leads to the error [ERR_TOO_MANY_REDIRECTS]
> (A HttpServlet is registered to redirect to a welcome page)
>
> Inserting also the servlet path [/web]
> http://127.0.0.1:50787/jLZHweb/web/eub.jlzhtools/js/chart.html
>
> leads to [HTTP ERROR: 404 Not Found]
>
> Is it possible to access the file like this and, if yes,
> how do I get the correct URL for it?
>
> Thanks and regards, Julia
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03868 seconds