• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

portlet session?

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is portlet session is same as servlet session?

Can two portlet share the same portlet session just like two servlet can share servlet session?

Thanks.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
PortletSession extends the HttpServletSession.
The PortletSession object is different for each portlet.
PortletSession of one portlet cannot be accessed by another portlet.
 
Author
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi rathi!

Are you talking about JSR 168 portlets or some vendor specific programming model (IBM, for instance)?

In JSR 168, the PortletSession is technically the same as the HttpSession from the underlying Web application. But the important difference is, that the PortletSession interface enables you to use two different scopes: application and portlet. If you use application, all portlets of the same portlet application share the same user session. Therefore you can exchange attributes between portlets via a session, if the portlets are within the same portletapp. See JSR 168 spec or javadoc for details.

I hope that helped (drop a mail, if you use another API than JSR 168),
Stefan
[ December 16, 2005: Message edited by: Stefan Zoerner ]
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using IBM portlet. In that, two portlet can't share the same session. But then I didn't get the use of session. One portlet is adding something into session and the same portlet is getting that then what is the need of these all, it already have access to that data....

Hope my question is clear.

Please Comments.
Thanks.
 
Stefan Zoerner
Author
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rathi,

I do not know the IBM specific API, even WebSphere Portal allows you to use the standard compliant programming model JSR 168 (with its restrictions) starting with 5.0, and this is what we use.

But even within a single portlet a session at least enables you to keep state between requests, for instance navigational state. There are other options to accomplish this, but attributes within a session are convenient (arbitrary objects allowed, for instance) -- but use them wisely ;-)

Stefan
 
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic