WebSphere Portal Server - How to get PortletContext from Struts action

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > April 2006 > How to get PortletContext from Struts action





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to get PortletContext from Struts action
Saumil Shah

2006-04-27, 8:07 am

I'm working on a Struts portlet application. How do I get a handle to a PortletContext object from a Strut action? I tried following different ways but it doesn't seem to work.

Method 1
PortletConfig pcf = (PortletConfig)(this.getServlet().getServletConfig());
PortletContext pc = pcf.getContext();

Method 2
PortletContext pc = (PortletContext)(req.getPortletSession().getServletContext());

Thanks
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com