Skip to main content



      Home
Home » Eclipse Projects » Equinox » Two bundles with JSPs
Two bundles with JSPs [message #122432] Thu, 11 December 2008 03:27 Go to next message
Eclipse UserFriend
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 06:41 Go to previous message
Eclipse UserFriend
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
Previous Topic:automatically update list of update sites
Next Topic:Use of Extension Locations in Eclipse 3.4 no longer possible
Goto Forum:
  


Current Time: Sun Jun 01 07:33:59 EDT 2025

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

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

Back to the top