Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Serving static content with RAP-application
Serving static content with RAP-application [message #541586] Mon, 21 June 2010 16:32 Go to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi,

we are using some javascript-files in our RAP-Application which
currently are deployed directly to an apache server.
To simplify development, it would be really nice, if Jetty could also
serve these js-files.
Would someone please tell me, how to configure the project to do so? I
can't seem to find an option like "web-root" or similar.

Thanks,
Philipp
Re: Serving static content with RAP-application [message #541690 is a reply to message #541586] Tue, 22 June 2010 08:20 Go to previous messageGo to next message
Martijn Cremer is currently offline Martijn CremerFriend
Messages: 77
Registered: January 2010
Location: Breda
Member

Do you mean somting like this:

http://wiki.eclipse.org/RAP/FAQ#How_do_I_add_an_applet_.2F_f lash_.2F_an_existing_Javascript_libary

Or do you mean you want to add it to the WAR file if so you can do that just by puting them in the template folder of the root of your war file.


hm. I've lost a machine.. literally _lost_. it responds to ping, it works completely, I just can't figure out where in my apartment it is.
Re: Serving static content with RAP-application [message #541695 is a reply to message #541690] Tue, 22 June 2010 08:29 Go to previous messageGo to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Actually I was hoping for something a little more easy like putting it
into a folder and then it's accessible by some URL. But probably we'll
have to go the widget-way, then.

Regards,
Philipp

Am 22.06.10 10:20, schrieb Martijn Cremer:
> Do you mean somting like this:
>
> http://wiki.eclipse.org/RAP/FAQ#How_do_I_add_an_applet_.2F_f
> lash_.2F_an_existing_Javascript_libary
>
> Or do you mean you want to add it to the WAR file if so you can do that
> just by puting them in the template folder of the root of your war file.
Re: Serving static content with RAP-application [message #541706 is a reply to message #541695] Tue, 22 June 2010 09:23 Go to previous messageGo to next message
Benjamin Wolff is currently offline Benjamin WolffFriend
Messages: 136
Registered: July 2009
Senior Member
Hi, don't worry, it is as easy as putting it into a folder. But you have to register these ressources with an extension point. Then you can access these files like <url>/bla/script.js
I don't know if this fits your use-case. However, you should search this newsgroup for 'register resources' oder 'static content', i think there's also a FAQ entry.

HTH,
Ben

Am 22.06.2010 10:29, schrieb Philipp Leusmann:
> Actually I was hoping for something a little more easy like putting it
> into a folder and then it's accessible by some URL. But probably we'll
> have to go the widget-way, then.
>
> Regards,
> Philipp
>
> Am 22.06.10 10:20, schrieb Martijn Cremer:
>> Do you mean somting like this:
>>
>> http://wiki.eclipse.org/RAP/FAQ#How_do_I_add_an_applet_.2F_f
>> lash_.2F_an_existing_Javascript_libary
>>
>> Or do you mean you want to add it to the WAR file if so you can do that
>> just by puting them in the template folder of the root of your war file.
>
Re: Serving static content with RAP-application [message #541723 is a reply to message #541706] Tue, 22 June 2010 10:18 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Philipp,

you can also register a whole directory as a resource using the
extension point org.eclipse.equinox.http.registry.resources.

Just add an extension like this to your plug-in (not sure about the
trailing slashes, try it out):

<extension
point="org.eclipse.equinox.http.registry.resources">
<resource
alias="/your-base-url/"
base-name="/your-directory/">
</resource>
</extension>

Regards, Ralf

Benjamin Wolff wrote:
> Hi, don't worry, it is as easy as putting it into a folder. But you have
> to register these ressources with an extension point. Then you can
> access these files like <url>/bla/script.js
> I don't know if this fits your use-case. However, you should search this
> newsgroup for 'register resources' oder 'static content', i think
> there's also a FAQ entry.
>
> HTH,
> Ben
>
> Am 22.06.2010 10:29, schrieb Philipp Leusmann:
>> Actually I was hoping for something a little more easy like putting it
>> into a folder and then it's accessible by some URL. But probably we'll
>> have to go the widget-way, then.
>>
>> Regards,
>> Philipp
>>
>> Am 22.06.10 10:20, schrieb Martijn Cremer:
>>> Do you mean somting like this:
>>>
>>> http://wiki.eclipse.org/RAP/FAQ#How_do_I_add_an_applet_.2F_f
>>> lash_.2F_an_existing_Javascript_libary
>>>
>>> Or do you mean you want to add it to the WAR file if so you can do that
>>> just by puting them in the template folder of the root of your war file.
>>
Re: Serving static content with RAP-application [message #541735 is a reply to message #541723] Tue, 22 June 2010 11:42 Go to previous message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Ralf,

that was the response I was hoping for. Looks great.

Thanks,
Philipp

Am 22.06.10 12:18, schrieb Ralf Sternberg:
> Hi Philipp,
>
> you can also register a whole directory as a resource using the
> extension point org.eclipse.equinox.http.registry.resources.
>
> Just add an extension like this to your plug-in (not sure about the
> trailing slashes, try it out):
>
> <extension
> point="org.eclipse.equinox.http.registry.resources">
> <resource
> alias="/your-base-url/"
> base-name="/your-directory/">
> </resource>
> </extension>
>
> Regards, Ralf
>
> Benjamin Wolff wrote:
>> Hi, don't worry, it is as easy as putting it into a folder. But you have
>> to register these ressources with an extension point. Then you can
>> access these files like<url>/bla/script.js
>> I don't know if this fits your use-case. However, you should search this
>> newsgroup for 'register resources' oder 'static content', i think
>> there's also a FAQ entry.
>>
>> HTH,
>> Ben
>>
>> Am 22.06.2010 10:29, schrieb Philipp Leusmann:
>>> Actually I was hoping for something a little more easy like putting it
>>> into a folder and then it's accessible by some URL. But probably we'll
>>> have to go the widget-way, then.
>>>
>>> Regards,
>>> Philipp
>>>
>>> Am 22.06.10 10:20, schrieb Martijn Cremer:
>>>> Do you mean somting like this:
>>>>
>>>> http://wiki.eclipse.org/RAP/FAQ#How_do_I_add_an_applet_.2F_f
>>>> lash_.2F_an_existing_Javascript_libary
>>>>
>>>> Or do you mean you want to add it to the WAR file if so you can do that
>>>> just by puting them in the template folder of the root of your war file.
>>>
Previous Topic:BrowserFunction example
Next Topic:Custom event listeners in views
Goto Forum:
  


Current Time: Fri Apr 19 19:02:05 GMT 2024

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

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

Back to the top