I'm trying to figure out the best-practice to allow two servlets that are deployed in two separate contexts to share an array of Java beans.
I'm working with WebSphere, and have a servlet that is to be shared by many different portlets that are defined by many different portlet-apps. Each portlet-app is deployed separately from the other portlet-apps, so they don't share the same session or servlet context like I thought that they might.
The basic idea was to have a portlet 'Pa' set a Java bean array attribute (keyed with 'paJavaBeans') onto its session, and then from that portlet's JSP, call servlet 'S' and have servlet 'S' get the same session attribute (using the key 'paJavaBeans') to process. Found out that the request.getSession() of servlet 'S' is different than the request.getSession() of 'Pa', so the 'paJavaBeans' attribute wasn't shareable via those session objects. I figured that would be too easy, but gave it a try anyway.
My main goal was to avoid having to deploy a copy of servlet 'S' with each webmodule, but instead deploy just one and have all other webmodules access and share it.
If anyone could point me in the right direction to the best-practice that could satisfy this request, I'd appreciate it.
Thanks for your time,