accessing the HttpServlet or ServletContext [message #81852] |
Mon, 07 April 2008 09:08  |
Eclipse User |
|
|
|
Originally posted by: pfischer06.fast-mail.org
Hello all,
I need to access the HttpServlet or ServletContext of the running
BridgeServlet before the first request. That's why I can't use
org.eclipse.rwt.RWT.
Is there an easy way to get one of them in my own bundle?
regards
Peter
|
|
|
|
|
|
|
|
Re: accessing the HttpServlet or ServletContext [message #83202 is a reply to message #83118] |
Wed, 16 April 2008 00:08  |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi Peter,
I'm not sure if I really understand, but you can access the OSGi
provided HttpContext using:
ServiceReference reference ...
String name = HttpContextExtensionService.class.getName();
ServiceReference serviceRef = context.getServiceReference( name );
HttpContextExtensionService service
= ( HttpContextExtensionService )context.getService( serviceRef );
HttpContext rapContext
= service.getHttpContext( reference, "org.eclipse.rap.httpcontext" );
Unfortunately I don't know a way to get to the ServletContext object
this maps to. As this belongs to the equinox stuff, maybe there is more
information available in the equinox newsgroup/mailinglist.
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Peter Fischer [mailto:pfischer06@fast-mail.org]
Bereitgestellt: Dienstag, 15. April 2008 19:31
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: accessing the HttpServlet or ServletContext
Betreff: Re: accessing the HttpServlet or ServletContext
Hello Frank,
Frank Appel wrote:
> the bundle Activator seems to be a reasonable choice. If your spring
> context is loaded using the webapp classloader you can configure the
> web.xml to make the necessary classes available within the RAP app.
> See 'extendedFrameworkExports' in the org.eclipse.rap.demo.feature's
> web.xml for more information. Note that you must use package import
> instead of bundle-dependencies to provide the according types at
development time.
This way we can use the classes deployed outside the osgi. That's it how
we use it now with the sping context as static member of one imported
class.
This works fine, but how about non static access to the spring-context.
I thougt it would be a better way to get the instance contained in the
ServletContext direct?
regards,
Peter
|
|
|
Powered by
FUDForum. Page generated in 0.04472 seconds