Image on server used by js lib [message #50956] |
Mon, 08 October 2007 14:03 |
Eclipse User |
|
|
|
Originally posted by: andreasruempel.gmx.net
Hi,
I want to display an image using a javascript library in my RAP
application and need this image to be present on the server accessible
via a specific path.
Does anybody know, how this could be done (perhaps using IResource)?
Thanks.
Andi
|
|
|
|
Re: Image on server used by js lib [message #51011 is a reply to message #50984] |
Mon, 08 October 2007 18:55 |
Eclipse User |
|
|
|
Originally posted by: andreasruempel.gmx.net
Thank you, it works fine that way.
Stefan Röck wrote:
> Hi Andi,
>
> you have to register the image first (i.e. on application startup). This can
> be achieved by the following lines code:
>
> InputStream inputStream =
> this.getClass().getClassLoader().getResourceAsStream("resources/back.png ");
> //$NON-NLS-1$
> RWT.getResourceManager().register("resources/back.png",
> inputStream); //$NON-NLS-1$
>
> You can then access the image via http://localhost:9080/resource/back.png.
> Please be aware of the fact that this image is also visible outside of a
> session scope, i.e. by everybody who knows the url.
>
> Regards,
> Stefan.
>
>
> "Andreas Rümpel" <andreasruempel@gmx.net> schrieb im Newsbeitrag
> news:feddb8$rne$1@build.eclipse.org...
>> Hi,
>>
>> I want to display an image using a javascript library in my RAP
>> application and need this image to be present on the server accessible via
>> a specific path.
>>
>> Does anybody know, how this could be done (perhaps using IResource)?
>>
>> Thanks.
>>
>> Andi
|
|
|
Powered by
FUDForum. Page generated in 0.04037 seconds