Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Portlets sharing a global variable

 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want a variable to be accessible to all the portlets. How do i achieve this with out using application scope variables?

Thanks,
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All portlets in a war file, or all portlets in the portal?

The PortletContext is global to all portlets packaged in a war, but can't be accessed outside the war.

For truely global variables, you'll need to do your own implementation - maybe something as simple as a common database table all portlets can read from. In the IBM world, we often do this through a PortletService.
 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to access all the portlets in a war file. so i will be using PortletContext. Thanks a lot for your reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic