How can I define the ServletContextHelper for a WAB? I can not find any hint in the R7 spec.
Richard Am Mo., 27. Juni 2022 um 16:15 Uhr schrieb Grzegorz Grzybek < [email protected]>: > Hi > > > pon., 27 cze 2022 o 16:04 Richard Hierlmeier <[email protected]> > napisał(a): > >> Hi Grzegorz. >> >> thank you for clarification. Unfortunately I can not upgrade to Karaf 4.4 >> the next time. >> What would happen when I define the session cookie name in jetty.xml and >> not in the wab? >> > > To answer more precisely, I'd have to check your current configuration - > what WAB are you deploying and what are the registration properties of the > HttpWhiteboard servlet. Only then I could check (going back to Karaf 4.3.7) > what may be the issue related to context configuration... > > regards > Grzegorz Grzybek > > >> >> >> Richard >> >> >> Am Mo., 27. Juni 2022 um 12:02 Uhr schrieb Grzegorz Grzybek < >> [email protected]>: >> >>> Hello >>> >>> Unfortunately, only with Pax Web 8 (used in Karaf 4.4+) we've refactored >>> the WAB/HttpService/Whiteboard inter operation. Pax Web 8 allows mixing web >>> elements coming from different "origins" (whiteboard registration, direct >>> registration using HttpService or web.xml/web-fragment.xml approach from >>> WABs). >>> >>> So in Pax Web 8 you should be able to reconfigure the session cookie >>> name and there servlets registered using Whiteboard targetting the same >>> context (as in WAB) should use the same session configuration. >>> >>> Also - Pax Web 8 implements correctly the session separation mentioned >>> in >>> https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.http.whiteboard.html#service.http.whiteboard.servletcontext >>> : >>> >>> Http Sessions are not shared amongst servlets registered with different >>>> ServletContextHelpers. That is, HttpRequest.getSession calls must provide >>>> different sessions per associated ServletContextHelper >>>> >>> >>> So even if two whiteboard servlets are registered to the same target >>> servlet context, but using different ServletContextHelper, they'll use >>> different session configuration. >>> >>> kind regards >>> Grzegorz Grzybek >>> >>> pon., 27 cze 2022 o 11:33 Richard Hierlmeier <[email protected]> >>> napisał(a): >>> >>>> >>>> My application runs in Karaf 4.3.7. I have a web application that is >>>> deployed as wab application bundle (wab). This web application changes the >>>> session cookie name in >>>> javax.servlet.ServletContextListener#contextInitialized(). >>>> >>>> In another bundle I have a servlet that is defined with HttpWhiteBoard. >>>> The servlets from the wab and the servlets from HttpWhiteBoard have >>>> different http sessions (because they have different session cookie names >>>> in the ServletContext). >>>> >>>> Is it possible to configure the session cookie for Servlets that are >>>> deployed via HttpWhiteBoard? >>>> >>>> Regards >>>> >>>> Richard >>>> >>>>
