Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Image on server used by js lib
Image on server used by js lib [message #50956] Mon, 08 October 2007 14:03 Go to next message
Eclipse UserFriend
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 #50984 is a reply to message #50956] Mon, 08 October 2007 14:12 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
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
Re: Image on server used by js lib [message #51011 is a reply to message #50984] Mon, 08 October 2007 18:55 Go to previous message
Eclipse UserFriend
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
Previous Topic:Registration of ServiceHandlers
Next Topic:404 error
Goto Forum:
  


Current Time: Sun Jul 14 14:06:21 GMT 2024

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

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

Back to the top