Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Get host servletcontext init param with mars servlet bridge
Get host servletcontext init param with mars servlet bridge [message #1705023] Tue, 11 August 2015 13:39 Go to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 220
Registered: March 2010
Location: France
Senior Member
Hello

I have an osgi application deployed in a legacy tomcat application through equinox servlet bridges

I used to be able to retrieve web.xml init param with getServletContext().getInitParameter("MyParam").

Since I have upgraded to equinox mars version, it returns null instead of the init param defined in web.xml.
It seems there were lot of refactoring around equinox http servlet implementation between luna and mars.

Do you know if there is a way to retrieve host init param from an osgi servlet inside equinox servlet bridge as before ?

Thanks,
Arnaud
Re: Get host servletcontext init param with mars servlet bridge [message #1705033 is a reply to message #1705023] Tue, 11 August 2015 14:27 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 486
Registered: July 2009
Senior Member
I'm a little surprised this worked before Mars. The servlet context init params are supposed to be specific to each ServletContext which should have been specific to each old HttpService HttpContext. Regardless of my surprise it sounds like you found a regression. Could you open a bug report so we can discuss possible solutions?
Re: Get host servletcontext init param with mars servlet bridge [message #1705036 is a reply to message #1705033] Tue, 11 August 2015 14:55 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 486
Registered: July 2009
Senior Member
I just confirmed that before Mars the HttpService ServletContext implementation would simply delegate to the parent container ServletContext for init params. With the latest OSGi Http Whiteboard specification there was a need to allow init params specific to each ServletContextHelper service registration (also maps to the old HttpContext objects).

In adding this support it was neglected that the old behavior simply got the init params from the parent ServletContext. I think the fix is to populate each internal ServletContext init params with the ones from the parent context and then allow them to be overriden by ServletContextHelper service properties if there are duplicates.

I went ahead and opened bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=474714
Re: Get host servletcontext init param with mars servlet bridge [message #1705037 is a reply to message #1705036] Tue, 11 August 2015 15:02 Go to previous message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 220
Registered: March 2010
Location: France
Senior Member
Thanks for the confirmation,
do you see a workaround that would allow to retrieve host init param from a servlet inside osgi ?
Previous Topic:Programmatically get java proposals for eclipse bundle
Next Topic:ClassNotFoundException for embedded activator when starting in eclipse target platform
Goto Forum:
  


Current Time: Thu Sep 20 07:07:15 GMT 2018

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

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

Back to the top