Two bundles with JSPs [message #122432] |
Thu, 11 December 2008 08:27 |
Eclipse User |
|
|
|
Originally posted by: morten.hindsholm.dk
I am currently investigating the possibility of developing a modular
web application based on OSGi.
It consists of a master bundle which contains the fundamental parts
(header, footer, menu and some common business logic) and a number of
bundles containing specific business logic and UI.
My main bundle has this fragment in it's plugin.xml for JSP
registration:
<extension
point="org.eclipse.equinox.http.registry.servlets">
<servlet
alias="/*.jsp"
class="org.eclipse.equinox.jsp.jasper.registry.JSPFactory"
httpcontextId="base">
</servlet>
</extension>
And the other bundle has this:
<extension
point="org.eclipse.equinox.http.registry.resources">
<resource
alias="/module1"
base-name="/module1"
httpcontextId="module1">
</resource>
</extension>
The idea is, that the main bundle uses the context root '/' while the
other bundle uses the context root '/module1'.
The problem is, that this does not work, when both bundles are active,
only one of them is able to serve JSPs. If I remove either of the
bundles, the other one works fine.
I am new to OSGi, so I have a feeling that I am missing something
here, but I haven't been able to find the answer, so I thought one of
you guys may be able to help.
TIA
--
/\/\orten
|
|
|
SOLVED: Two bundles with JSPs [message #122456 is a reply to message #122432] |
Thu, 11 December 2008 11:41 |
Eclipse User |
|
|
|
Originally posted by: morten.hindsholm.dk
Morten Hindsholm <morten@hindsholm.dk> writes:
> I am currently investigating the possibility of developing a modular
> web application based on OSGi.
>
> It consists of a master bundle which contains the fundamental parts
> (header, footer, menu and some common business logic) and a number of
> bundles containing specific business logic and UI.
>
> ...
>
> The idea is, that the main bundle uses the context root '/' while the
> other bundle uses the context root '/module1'.
>
> The problem is, that this does not work, when both bundles are active,
> only one of them is able to serve JSPs. If I remove either of the
> bundles, the other one works fine.
>
> I am new to OSGi, so I have a feeling that I am missing something
> here, but I haven't been able to find the answer, so I thought one of
> you guys may be able to help.
I managed to solve this one myself by giving the 'module1' bundle its own
httpcontext with a resource-mapping:
<extension
id="module1Httpcontext"
point="org.eclipse.equinox.http.registry.httpcontexts">
<httpcontext
id="module1">
<resource-mapping path="/module1"/>
</httpcontext>
</extension>
By the way, what are your experiences with multi-bundle web apps, if any?
--
/\/\orten
|
|
|
Powered by
FUDForum. Page generated in 0.01746 seconds