RE: Sharing session between portlet and servlet
"Noel J. Bergman" <[email protected]> Tue, 28 Oct 2008 19:22:03 -0400
| Newsgroups | gmane.comp.jakarta.pluto.user |
|---|---|
| Message-ID | <[email protected]> |
Eric wrote: > Portlets and Servlets in the same webapp can share session attributes > placed in the session by the portlet in the APPLICATION_SCOPE. There > is no provision in the portlet API for sharing session attributes > between webapps. Nor should there be, unless/until the Servlet Specification decides to take it up, and resolve the issues. > Michael wrote: > > I also tried to use the overloaded method of setAttribute [with] > > PortletSession.APPLICATION_SCOPE) [and] PortletSession.PORTLET_SCOPE) > > without success. Sorry, you have been bitten by the atrociously ill-chosen naming of the manifest constants. APPLICATION_SCOPDE means "don't encode my keys and show me all keys" and "PORTLET_SCOPE" means "encode my keys, and only show me keys encoded with my unique id." It has nothing to do with any real scope, being specific as it is to the Servlet Session scope. You can communicate between applications using Portlet Messaging. Event handling portlets in each webapp can place values into their respective servlet sessions using APPLICATION_SCOPE (unencoded keys), making them available to collocated servlets. --- Noel
smime.p7s
(application/x-pkcs7-signature, 2.9 KB) - not displayed