Skip to main content



      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 12:32 Go to next message
Eclipse UserFriend
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 04:20 Go to previous messageGo to next message
Eclipse UserFriend
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 #541695 is a reply to message #541690] Tue, 22 June 2010 04:29 Go to previous messageGo to next message
Eclipse UserFriend
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 05:23 Go to previous messageGo to next message
Eclipse UserFriend
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 06:18 Go to previous messageGo to next message
Eclipse UserFriend
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 07:42 Go to previous message
Eclipse UserFriend
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: Sun Jul 27 16:31:18 EDT 2025

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

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

Back to the top