How to reference HTML inside jars [message #464707] |
Tue, 13 March 2007 22:03 |
Eclipse User |
|
|
|
Originally posted by: mash_909.yahoo.co.uk
One of my plugins contains a simple HTML info page displayed using the
Browser widget. When I export my app, this plugin is exported as a jar.
When the app references the HTML, any other files (ie images, css)
referenced by the HTML cannot be read, obviously because the jar knows
nothing about the path structure.
In the Eclipse RCP book (McAffer, Lemieux. p125) it states "if your
plugin is shipped as a jar file and the about.html references other
pages in the plug-in, the additional pages must be in a directory called
about_files at the root of the plugin. This is required because Eclipse
extracts the files from the JAR before presenting the root file in the
web browser - browsers typically cannot see inside JARs."
So I take this to mean that if I have a file in my jar called
about.html, and this file references 'info.gif', then the HTML would
contain this:
<img src="info.gif">
and about.jar would be structured thus:
-about.html
---about_files/
-------info.gif
However - I cannot get this to work after exporting: The HTML appears,
ok, but the image does not.
Does anyone know what I'm doing wrong?
thanks
Matt
|
|
|
Powered by
FUDForum. Page generated in 0.02371 seconds