[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [equinox-dev] Regarding filters and listenersserversideequinoxwith servlet bridge.

Thanks fox! I will try this.





From: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of fox
Sent: Monday, January 04, 2010 7:54 AM
To: Equinox development mailing list
Subject: RE: [equinox-dev] Regarding filters and listenersserversideequinoxwith servlet bridge.


Hi Shashi

Here is my piece of code.


public class Activator implements BundleActivator {

private ServiceTracker httpServiceTracker;

String jspContext = "/jsps";

String jspFolder = "/web_files"; //the jsp folder your page in

public void start(BundleContext context) throws Exception {

httpServiceTracker = new HttpServiceTracker(context);



public void stop(BundleContext context) throws Exception {



private class HttpServiceTracker extends ServiceTracker {

public HttpServiceTracker(BundleContext context) {

super(context, HttpService.class.getName(), null);


public Object addingService(ServiceReference reference) {

final HttpService httpService = (HttpService) context


try {

HttpContext commonContext = new BundleEntryHttpContext(context

.getBundle(), jspFolder);

httpService.registerResources(jspContext, "/", commonContext);

Servlet adaptedJspServlet = new ContextPathServletAdaptor(

new JspServlet(context.getBundle(), jspFolder),


httpService.registerServlet(jspContext + "/*.jsp",

adaptedJspServlet, null, commonContext);

} catch (Exception e) {



return httpService;


public void removedService(ServiceReference reference, Object service) {

final HttpService httpService = (HttpService) service;


httpService.unregister(jspContext + "/*.jsp");

super.removedService(reference, service);





best regards.



发件人: Shashikant Kale

发送时间: 2009-12-22  17:26:24

收件人: Equinox development mailing list


主题: RE: [equinox-dev] Regarding filters and listeners serversideequinoxwith servlet bridge.

Thanks much Fox.


Do you have any example showing how to use the helper?


Thanks for your help,



From: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of fox
Sent: Tuesday, December 22, 2009 2:52 PM
To: Equinox development mailing list
Subject: Re: [equinox-dev] Regarding filters and listeners server sideequinoxwith servlet bridge.


Hi Shashi:

    Here is the jar file of org.eclipse.equinox.http.helper_1.0.0.200801161414.jar that you want,please check it.


best regards.





发件人: Shashikant Kale

发送时间: 2009-12-22  17:10:15

收件人: equinox-dev@xxxxxxxxxxx


主题: [equinox-dev] Regarding filters and listeners server side equinoxwith servlet bridge.



We have a project wherein we embed a servlet container within OSGi and run a web project. Now we need to extend this further and run within an application server. I am planning to use equinox servlet bridge for this. However we have a requirement to have filter and listener within the project. As per the OSGi http specs these are not yet supported.


I would like to know if there are any alternatives to achieve this. I am taking a look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=128067 which talks about filter support in OSGi http service however am unsure of how to use it.


Also I took a look at the comment from Simon Kaegi for achieving this functionality in the bug above.


If you want to look at an approach that works currently to support many of the
Filter and Listener use-cases take a look in the
equinox-incubator/org.eclipse.equinox.http.helper project.”
However I am not able to get the org.eclipse.equinox.http.helper project anymore.


Could somebody please point to where I can find some more information regarding this.


Thanks in advance,