portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Dam <d....@hippo.nl>
Subject NULL servletcontext for local portlet apps
Date Mon, 17 Dec 2007 22:22:59 GMT
Hi all,

Does anybody know why the context root of local portlet applications is 
set to "<portal>" in PortletApplicationManager ? I ran into the problem 
when I got a NPE for the local servletcontext when I deployed a portlet 
app in the local deploy dir, by accident :) My portlets do cross-context 
includes and use the ServletContextProviderImpl to fetch the portlet 
app's servlet context, and use that context to get the other webapp's 
context.  Can we safely change <portal> to jetspeed's context root ? 
Even better, since we know that the portlet app is running locally, why 
not use Jetspeed's servletcontext when creating portlet instances in 
JetspeedPortletFactory.getPortletInstance() ? For example:

PortletContext portletContext;
if (pa.getApplicationType()==MutablePortletApplication.LOCAL){
  portletContext = 
PortalAccessor.createPortletContext(jetspeedServletContext, pa);      // 
use jetspeed's servlet context    
} else {
  portletContext = PortalAccessor.createPortletContext(servletContext, 
pa);     // default 
}

the only thing left to do is inject the Jetspeed servletcontext Spring 
bean in the JetspeedPortletFactory to set the jetspeedServletContext var.

WDYT?

Dennis

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


Mime
View raw message