Serving static content with RAP-application [message #541586] |
Mon, 21 June 2010 12:32  |
Eclipse User |
|
|
|
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 #541706 is a reply to message #541695] |
Tue, 22 June 2010 05:23   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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.
>>>
|
|
|
Powered by
FUDForum. Page generated in 0.05440 seconds