You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-user@portals.apache.org by "Hernandez, Carlos A." <ca...@intercall.com> on 2007/02/09 16:39:35 UTC

Cant find session variable

Hello Guys,

 

I'm using Pluto 1.1 since I'm developing some portlets. But I'm having problems using the session for the application scope.

 

I got this portlet that stores an object into session. That object must be seen by another portlet. This is what I do

 

getPortletSession ().setAttribute ( CRED_SESSION, object, PortletSession.APPLICATION_SCOPE );

 

An then in a second portlet (a completely different one, but the same portal server) I try this:

 

getPortletSession ().getAttribute (CRED_SESSION, PortletSession.APPLICATION_SCOPE )

 

I got a null and when I print the list returned by

 

final Enumeration names = session.getAttributeNames ( PortletSession.APPLICATION_SCOPE );

 

I can´t find no trace of my object.

 

What can I do?

 

And I got a doubt about the wires in Pluto, I'm "persisting" my object in static arrays for me to speed up my development

But it seems also that my arrays are not there. Do you have different classloaders for every portlet?

 

 

 

Thank you for your help I really appreciate it.

Carlos Alberto

 


Re: Cant find session variable

Posted by Marcus A Christie <ma...@cs.indiana.edu>.
Hernandez, Carlos A. wrote:
> Hello Guys,
> 
>  
> 
> I’m using Pluto 1.1 since I’m developing some portlets. But I’m having 
> problems using the session for the application scope.
> 
>  
> 
> I got this portlet that stores an object into session. That object must 
> be seen by another portlet. This is what I do
> 
>  
> 
> getPortletSession ().setAttribute ( CRED_SESSION, object, 
> PortletSession.APPLICATION_SCOPE );
> 
>  
> 
> An then in a second portlet (a completely different one, but the same 
> portal server) I try this:
> 
>  
> 
> getPortletSession ().getAttribute (CRED_SESSION, 
> PortletSession.APPLICATION_SCOPE )
> 
>  
> 
> I got a *null* and when I print the list returned by
> 

both portlets are in the same web application (webapp)?

Marc


Re: Cant find session variable

Posted by Yidong Fang <fa...@gmail.com>.
According to the servlet spec,sessions don't cross different webapps.

On 2/9/07, Hernandez, Carlos A. <ca...@intercall.com> wrote:
>
>  Hello Guys,
>
>
>
> I'm using Pluto 1.1 since I'm developing some portlets. But I'm having
> problems using the session for the application scope.
>
>
>
> I got this portlet that stores an object into session. That object must be
> seen by another portlet. This is what I do
>
>
>
> getPortletSession ().setAttribute ( CRED_SESSION, object,
> PortletSession.APPLICATION_SCOPE );
>
>
>
> An then in a second portlet (a completely different one, but the same
> portal server) I try this:
>
>
>
> getPortletSession ().getAttribute (CRED_SESSION,
> PortletSession.APPLICATION_SCOPE )
>
>
>
> I got a *null* and when I print the list returned by
>
>
>
> final Enumeration names = session.getAttributeNames (
> PortletSession.APPLICATION_SCOPE );
>
>
>
> I can´t find no trace of my object.
>
>
>
> What can I do?
>
>
>
> And I got a doubt about the wires in Pluto, I'm "persisting" my object in
> static arrays for me to speed up my development
>
> But it seems also that my arrays are not there. Do you have different
> classloaders for every portlet?
>
>
>
>
>
>
>
> Thank you for your help I really appreciate it.
>
> Carlos Alberto
>
>
>



-- 
JSON: Action in AJAX!

JSON - http://www.json.org
JSON.simple - http://www.json.org/java/simple.txt