code: protected ApplicationContext findWebApplicationContext() {
          String attrName = getContextAttribute();
          final PortletApplicationContext portletApplicationContext;
          if (attrName != null) {
              portletApplicationContext = PortletApplicationContextUtils2.getPortletApplicationContext(getPortletContext(), attrName);
          }
          else {
              portletApplicationContext = PortletApplicationContextUtils2.getPortletApplicationContext(getPortletContext());
          }
  
          if (portletApplicationContext != null) {
              return portletApplicationContext;
          }
  
          return PortletApplicationContextUtils.getWebApplicationContext(getPortletContext());
      }
docs: Retrieve a <code>WebApplicationContext</code> from the <code>PortletContext</code>. The
  <code>WebApplicationContext</code> must have already been loaded and stored in the
  <code>PortletContext</code> before this filter gets initialized (or invoked).
  <p>Subclasses may override this method to provide a different
  <code>WebApplicationContext</code> retrieval strategy.
  
  @return the WebApplicationContext for this proxy, or <code>null</code> if not found