@Override
    protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) {
        final PortletContext portletContext = this.getPortletContext();
        final PortletApplicationContext parentPortletApplicationContext = PortletApplicationContextUtils2.getPortletApplicationContext(portletContext);
        if (parentPortletApplicationContext != null) {
            //Found the parent PortletApplicationContext, use it as the parent
            return super.createPortletApplicationContext(parentPortletApplicationContext);
        }

        //No parent PortletApplicationContext was found, use the root web application context as the parent
        return super.createPortletApplicationContext(parent);
    }
@ Override protected ApplicationContext createPortletApplicationContext ( ApplicationContext parent ) { final PortletContext portletContext = this . getPortletContext ( ) ; final PortletApplicationContext parentPortletApplicationContext = PortletApplicationContextUtils2 . getPortletApplicationContext ( portletContext ) ; if ( parentPortletApplicationContext != null ) { return super . createPortletApplicationContext ( parentPortletApplicationContext ) ; } return super . createPortletApplicationContext ( parent ) ; }
{@inheritDoc}

Uses {@link PortletApplicationContextUtils2#getPortletApplicationContext(PortletContext)} to see if
the portlet application level context has been loaded. The portlet applications's context is then used
as the parent for the portlet's context.