Home » Eclipse Projects » Equinox » How to package web application as bundles ?
How to package web application as bundles ? [message #106697] |
Thu, 20 March 2008 09:13 |
|
Hi,
I want to package an Ajax framework as an Equinox bundle, this application
contains jars,css,javascript and taglibs. In plain web application we
usually define this taglib URI in web.xml, but how do you do so in bundle ?
Also, once you have package it as bundle, how do you access it from jsp
pages defined in other bundles ?
Any help would be greatly appreciated.
Best Regards,
Setya
|
|
|
Re: How to package web application as bundles ? [message #106832 is a reply to message #106697] |
Wed, 26 March 2008 11:07 |
Eclipse User |
|
|
|
Originally posted by: Boyan.Yurukov.softwareag.com
Hi Setya,
I am trying to do the same thing with Axis2, so here are some tips that my
help.
Put the whole application as it is in a bundle project. Add all packages as
imported and exported in the Manifest. Also import these three packages:
org.osgi.framework, org.osgi.service.http, org.osgi.util.tracker
Skip the web.xml. In it you basically have a mapping of different paths to
servlets. What you need to do is a ServiceTracker class that provides an
HttpService. In that HttpService you need to register all those resources
and servlets as they are mapped in the web.xml. It would be cool to have a
tool that reads and parses that information from a web.xml automatically,
but I don't know of such.
Then you have to make an Activator that starts the service tracker. Get the
server-side Equinox and check the example bundles to see how the activator
and the service tracker are implemented.
I hope this helped.
Greetings,
Boyan.
"Setya" <jsetya@gmail.com> wrote in message
news:9896d210367ae76d253230efaf984fa2$1@www.eclipse.org...
> Hi,
>
> I want to package an Ajax framework as an Equinox bundle, this application
> contains jars,css,javascript and taglibs. In plain web application we
> usually define this taglib URI in web.xml, but how do you do so in bundle
> ?
>
> Also, once you have package it as bundle, how do you access it from jsp
> pages defined in other bundles ?
>
> Any help would be greatly appreciated.
>
> Best Regards,
>
> Setya
>
|
|
|
Re: How to package web application as bundles ? [message #106899 is a reply to message #106832] |
Thu, 27 March 2008 03:25 |
|
Hi Boyan,
> I am trying to do the same thing with Axis2, so here are some tips that my
> help.
> Put the whole application as it is in a bundle project. Add all packages as
> imported and exported in the Manifest. Also import these three packages:
> org.osgi.framework, org.osgi.service.http, org.osgi.util.tracker
> Skip the web.xml. In it you basically have a mapping of different paths to
> servlets. What you need to do is a ServiceTracker class that provides an
> HttpService. In that HttpService you need to register all those resources
> and servlets as they are mapped in the web.xml. It would be cool to have a
> tool that reads and parses that information from a web.xml automatically,
> but I don't know of such.
> Then you have to make an Activator that starts the service tracker. Get the
> server-side Equinox and check the example bundles to see how the activator
> and the service tracker are implemented.
Thank you for your lengthy explanation.
Let's say I have bundle A that registers its resources either via service
tracker or declaratively in plugin.xml, is it possible for jsp pages in
bundle B to use javascripts, css etc of bundle A ?
Regards,
Setya
|
|
|
Re: How to package web application as bundles ? [message #106912 is a reply to message #106899] |
Thu, 27 March 2008 17:20 |
Eclipse User |
|
|
|
Originally posted by: Boyan.Yurukov.softwareag.com
Well, when they are registered, they get their own path, so you can
access them through that URL. For example the html that a jsp generates
can import any css that another bundle has registered as a resource. To
the outside world the insides of the system are transparent. Which
bundle regs which resource/servlet is irrelevant, as long as it is
available to an outside user.
On the other hand, if you want to access them internally, you need to
treat them as regular resources and get them through the classloader. I
am not sure what restrictions there are for such cases.
Greetings,
Boyan.
Setya wrote:
> Hi Boyan,
>
>> I am trying to do the same thing with Axis2, so here are some tips
>> that my help.
>
>> Put the whole application as it is in a bundle project. Add all
>> packages as imported and exported in the Manifest. Also import these
>> three packages: org.osgi.framework, org.osgi.service.http,
>> org.osgi.util.tracker
>
>> Skip the web.xml. In it you basically have a mapping of different
>> paths to servlets. What you need to do is a ServiceTracker class that
>> provides an HttpService. In that HttpService you need to register all
>> those resources and servlets as they are mapped in the web.xml. It
>> would be cool to have a tool that reads and parses that information
>> from a web.xml automatically, but I don't know of such.
>
>> Then you have to make an Activator that starts the service tracker.
>> Get the server-side Equinox and check the example bundles to see how
>> the activator and the service tracker are implemented.
>
> Thank you for your lengthy explanation.
>
> Let's say I have bundle A that registers its resources either via
> service tracker or declaratively in plugin.xml, is it possible for jsp
> pages in bundle B to use javascripts, css etc of bundle A ?
>
> Regards,
>
> Setya
>
|
|
|
Re: How to package web application as bundles ? [message #108167 is a reply to message #106912] |
Tue, 15 April 2008 13:54 |
Eclipse User |
|
|
|
Originally posted by: Boyan.Yurukov.softwareag.com
Hi all,
See this tutorial regarding providing jsps inside an osgi bundle:
http://dev.nepomuk.semanticdesktop.org/wiki/JspPagesInOsgi
Boyan.
"Boyan Yurukov" <Boyan.Yurukov@softwareag.com> wrote in message
news:fsgl0i$el2$1@build.eclipse.org...
> Well, when they are registered, they get their own path, so you can access
> them through that URL. For example the html that a jsp generates can
> import any css that another bundle has registered as a resource. To the
> outside world the insides of the system are transparent. Which bundle regs
> which resource/servlet is irrelevant, as long as it is available to an
> outside user.
>
> On the other hand, if you want to access them internally, you need to
> treat them as regular resources and get them through the classloader. I am
> not sure what restrictions there are for such cases.
>
> Greetings,
> Boyan.
>
>
>
> Setya wrote:
>> Hi Boyan,
>>
>>> I am trying to do the same thing with Axis2, so here are some tips that
>>> my help.
>>
>>> Put the whole application as it is in a bundle project. Add all packages
>>> as imported and exported in the Manifest. Also import these three
>>> packages: org.osgi.framework, org.osgi.service.http,
>>> org.osgi.util.tracker
>>
>>> Skip the web.xml. In it you basically have a mapping of different paths
>>> to servlets. What you need to do is a ServiceTracker class that provides
>>> an HttpService. In that HttpService you need to register all those
>>> resources and servlets as they are mapped in the web.xml. It would be
>>> cool to have a tool that reads and parses that information from a
>>> web.xml automatically, but I don't know of such.
>>
>>> Then you have to make an Activator that starts the service tracker. Get
>>> the server-side Equinox and check the example bundles to see how the
>>> activator and the service tracker are implemented.
>>
>> Thank you for your lengthy explanation.
>>
>> Let's say I have bundle A that registers its resources either via service
>> tracker or declaratively in plugin.xml, is it possible for jsp pages in
>> bundle B to use javascripts, css etc of bundle A ?
>>
>> Regards,
>>
>> Setya
>>
|
|
| |
Goto Forum:
Current Time: Fri Mar 29 01:57:28 GMT 2024
Powered by FUDForum. Page generated in 0.03966 seconds
|