Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting PortletSession in JSF

sujith Acharya
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have a requirement to set an attribute in PortletSession in JSF portlet.
How can I get portletSession instance in PageCodeBase ?
I tried,
PortletRequest portletRequest=(PortletRequest)getFacesContext().getExternalContext().getRequest();
PortletSession session = portletRequest.getPortletSession();

In this line : portletRequest=(PortletRequest)getFacesContext().getExternalContext().getRequest();
But the Object we are getting here can not be Type casted to Portlet request. So its throwing exception.

Is there any alternative to get PortletSession in in PageCodeBase?

-Thanks in advance
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic