/** * Create a new PortletContextResourcePatternResolver. * @param portletContext the PortletContext to load resources with * @see PortletContextResourceLoader#PortletContextResourceLoader(javax.portlet.PortletContext) */ public PortletContextResourcePatternResolver(PortletContext portletContext) { super(new PortletContextResourceLoader(portletContext)); }
/** * Create a new PortletContextResourcePatternResolver. * @param portletContext the PortletContext to load resources with * @see PortletContextResourceLoader#PortletContextResourceLoader(javax.portlet.PortletContext) */ public PortletContextResourcePatternResolver(PortletContext portletContext) { super(new PortletContextResourceLoader(portletContext)); }
/** * Map config parameters onto bean properties of this portlet, and * invoke subclass initialization. * @throws PortletException if bean properties are invalid (or required * properties are missing), or if subclass initialization fails. */ @Override public final void init() throws PortletException { if (logger.isInfoEnabled()) { logger.info("Initializing portlet '" + getPortletName() + "'"); } // Set bean properties from init parameters. try { PropertyValues pvs = new PortletConfigPropertyValues(getPortletConfig(), this.requiredProperties); BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this); ResourceLoader resourceLoader = new PortletContextResourceLoader(getPortletContext()); bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader, getEnvironment())); initBeanWrapper(bw); bw.setPropertyValues(pvs, true); } catch (BeansException ex) { logger.error("Failed to set bean properties on portlet '" + getPortletName() + "'", ex); throw ex; } // let subclasses do whatever initialization they like initPortletBean(); if (logger.isInfoEnabled()) { logger.info("Portlet '" + getPortletName() + "' configured successfully"); } }
PropertyValues pvs = new PortletConfigPropertyValues(getPortletConfig(), this.requiredProperties); BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this); ResourceLoader resourceLoader = new PortletContextResourceLoader(getPortletContext()); bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader, this.environment)); initBeanWrapper(bw);