You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by hamid bani <ha...@yahoo.com> on 2006/05/14 13:09:32 UTC

Re: servlet portlet communication via JetSpeed

Dear Jacek
 
 I am actually looking for a mechanism to use JetSpeed mechanism to help me 
give my servlet an object produced by my portlet !

Is it possible that the portal help me ?

tnx alot!

Jacek Wi�licki <ja...@gmail.com> wrote: Wiadomosc od hamid bani z 2006-05-14 09:39 brzmiala:

> Is it possible for a portlet to put an object in its application scope session and then 
>   a servlet get that object throgh ite session ?
>    
>   Assume that the portlet and the servlet are in the same War file !
Use APPLICATION_SCOPE or cast a PortletSession object to HttpSession.

-- 
pozdrawiam,
     Jacek Wislicki

jacek.wislicki@gmail.com
tel.: +48 502 408 444
gg: 2540358
skype: jacek_wislicki

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org



		
---------------------------------
Get amazing travel prices for air and hotel in one click on Yahoo! FareChase 

Re: servlet portlet communication via JetSpeed

Posted by Aaron Evans <aa...@gmail.com>.
Jacek is absolutely correct.

Set the object in the portlet's session with application scope.  Then,
in your servlet, the object will be available as a standard
HttpSession attribute.

I use this technique all the time...

On 5/14/06, Jacek Wiślicki <ja...@gmail.com> wrote:
> Wiadomosc od hamid bani z 2006-05-14 16:37 brzmiala:
>
> > Dear Jacek
> >
> >   At the moment I can't use this approach you suggested
> >   because my servlet is not called from my portlet!
> >
> >   Is there any other way ?
> If you have a HttpSession attribute, there is no difference if it is set
> from a servlet or a portlet. Once it is set, it should be hold in the
> session until the session is invalidated or the attribute is removed.
> What's the problem?
>
> --
> pozdrawiam,
>      Jacek Wislicki
>
> jacek.wislicki@gmail.com
> tel.: +48 502 408 444
> gg: 2540358
> skype: jacek_wislicki
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>

Re: servlet portlet communication via JetSpeed

Posted by Jacek Wiślicki <ja...@gmail.com>.
Wiadomosc od hamid bani z 2006-05-14 16:37 brzmiala:

> Dear Jacek
>    
>   At the moment I can't use this approach you suggested 
>   because my servlet is not called from my portlet!
>    
>   Is there any other way ?
If you have a HttpSession attribute, there is no difference if it is set 
from a servlet or a portlet. Once it is set, it should be hold in the 
session until the session is invalidated or the attribute is removed. 
What's the problem?

-- 
pozdrawiam,
     Jacek Wislicki

jacek.wislicki@gmail.com
tel.: +48 502 408 444
gg: 2540358
skype: jacek_wislicki

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Re: servlet portlet communication via JetSpeed

Posted by hamid bani <ha...@yahoo.com>.
Dear Jacek
   
  At the moment I can't use this approach you suggested 
  because my servlet is not called from my portlet!
   
  Is there any other way ?
   
  tnx alot!

Jacek Wi¶licki <ja...@gmail.com> wrote:
  Wiadomosc od hamid bani z 2006-05-14 13:09 brzmiala:

> Dear Jacek
> 
> I am actually looking for a mechanism to use JetSpeed mechanism to help me 
> give my servlet an object produced by my portlet !
> 
> Is it possible that the portal help me ?
Yes, use:
.getPortletSession().setAttribute(, 
    , PortletSession.APPLICATION_SCOPE);
or:
((HttpSession)
).setAttribute(attrName>,     );

-- 
pozdrawiam,
     Jacek Wislicki

jacek.wislicki@gmail.com
tel.: +48 502 408 444
gg: 2540358
skype: jacek_wislicki

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org



		
---------------------------------
Get amazing travel prices for air and hotel in one click on Yahoo! FareChase 

Re: servlet portlet communication via JetSpeed

Posted by Jacek Wiślicki <ja...@gmail.com>.
Wiadomosc od hamid bani z 2006-05-14 13:09 brzmiala:

> Dear Jacek
>  
>  I am actually looking for a mechanism to use JetSpeed mechanism to help me 
> give my servlet an object produced by my portlet !
> 
> Is it possible that the portal help me ?
Yes, use:
<RenderRequest>.getPortletSession().setAttribute(<String attrName>, 
<Object attrValue>, PortletSession.APPLICATION_SCOPE);
or:
((HttpSession)<PortletSession yourPortletSession>).setAttribute(<String 
attrName>, <Object attrValue>);

-- 
pozdrawiam,
     Jacek Wislicki

jacek.wislicki@gmail.com
tel.: +48 502 408 444
gg: 2540358
skype: jacek_wislicki

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org