05-21-04 10:39 PM
Bryan Hogan wrote:
> I also see that the PortletSessionImpl classes include a method named
> 'getHttpSession()' which will return the base HttpSession. Storing shared
> information into the base HttpSession would solve our problem; however, we
> would prefer not make hardcoded references to the implementation class in
> our code.
That's either broken, or I don't understand it. When you use
getHttpSession(), you *do* get an HttpSession object, but the keys
stored in the object are prefixed with what is probably the unique id of
the portlet application (not sure about that, but it sure isn't what I
put in there). For example, if you do
getHttpSession().setAttribute("foo", "bar")
when you iterate through getHttpSession().getAttributes() you see
something like "7_A_3_foo".
> I suspect that others have encountered this issue. What is the best way t
o
> deal with it?
I used a single bean for sharing information between the portlet and the
servlet. Then, in the servlet, I iterated through all values in the
session and matched the class against the class of the bean. Not
terribly elegant, but it did work...
B
[ Post a follow-up to this message ]
|