weaver      2004/03/01 18:48:12

  Modified:    portal/src/java/org/apache/jetspeed/container/invoker
                        ServletPortletInvoker.java
  Log:
  added check for web application presence

  
  Revision  Changes    Path
  1.12      +8 -2      
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java
  
  Index: ServletPortletInvoker.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ServletPortletInvoker.java        14 Jan 2004 01:47:27 -0000      1.11
  +++ ServletPortletInvoker.java        2 Mar 2004 02:48:12 -0000       1.12
  @@ -77,6 +77,7 @@
   import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
   import org.apache.pluto.core.impl.PortletConfigImpl;
   import org.apache.pluto.om.portlet.PortletDefinition;
  +import org.apache.pluto.om.servlet.WebApplicationDefinition;
   
   /**
    * ServletPortletInvoker invokes portlets in another web application, calling a 
  @@ -199,7 +200,12 @@
       {
           MutablePortletApplication app = 
(MutablePortletApplication)portletDefinition.getPortletApplicationDefinition();
   
  -        String portletApplicationName = 
app.getWebApplicationDefinition().getContextRoot();
  +        WebApplicationDefinition webApplicationDefinition = 
app.getWebApplicationDefinition();
  +        if(webApplicationDefinition == null)
  +        {
  +             throw new IllegalStateException("Portlet application "+app.getName()+ 
" has no associated web application.");
  +        }
  +        String portletApplicationName = webApplicationDefinition.getContextRoot();
   
           // gather all required data from request and response
           ServletRequest servletRequest = 
((javax.servlet.http.HttpServletRequestWrapper) portletRequest).getRequest();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to