@Override public WebRequest getObject() { PortletRequestAttributes requestAttr = currentRequestAttributes(); return new PortletWebRequest(requestAttr.getRequest(), requestAttr.getResponse()); }
@Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (this.portletContext != null && bean instanceof PortletContextAware) { ((PortletContextAware) bean).setPortletContext(this.portletContext); } if (this.portletConfig != null && bean instanceof PortletConfigAware) { ((PortletConfigAware) bean).setPortletConfig(this.portletConfig); } return bean; }
/** * This implementation supports pattern matching in unexpanded WARs too. * @see PortletContextResourcePatternResolver */ @Override protected ResourcePatternResolver getResourcePatternResolver() { return new PortletContextResourcePatternResolver(this); }
@Override public void registerDestructionCallback(String name, Runnable callback, int scope) { if (scope == SCOPE_REQUEST) { registerRequestDestructionCallback(name, callback); } else { registerSessionDestructionCallback(name, callback); } }
/** * {@inheritDoc} * <p>Replace {@code Portlet}- and {@code Servlet}-related property sources. */ @Override protected void initPropertySources() { PortletApplicationContextUtils.initPortletPropertySources(getEnvironment().getPropertySources(), this.servletContext, this.portletContext, this.portletConfig); }
/** * Replace any {@linkplain * org.springframework.core.env.PropertySource.StubPropertySource stub property source} * instances acting as placeholders with real portlet context/config property sources * using the given parameters. * @param servletContext the {@link ServletContext} (may be {@code null}) * @param portletContext the {@link PortletContext} (may not be {@code null}) * @param portletConfig the {@link PortletConfig} ({@code null} if not available) * @see org.springframework.web.portlet.context.PortletApplicationContextUtils#initPortletPropertySources( * org.springframework.core.env.MutablePropertySources, ServletContext, PortletContext, PortletConfig) */ public void initPropertySources(ServletContext servletContext, PortletContext portletContext, PortletConfig portletConfig) { PortletApplicationContextUtils.initPortletPropertySources(getPropertySources(), servletContext, portletContext, portletConfig); }
/** * This implementation supports file paths beneath the root of the web application. * @see PortletContextResource */ @Override protected Resource getResourceByPath(String path) { return new PortletContextResource(this.portletContext, path); }
/** * Create and return a new {@link StandardPortletEnvironment}. */ @Override protected ConfigurableEnvironment createEnvironment() { return new StandardPortletEnvironment(); }
/** * 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)); }
@Override public void setNamespace(String namespace) { this.namespace = namespace; if (namespace != null) { setDisplayName("Portlet ApplicationContext for namespace '" + namespace + "'"); } }
@Override public void setNamespace(String namespace) { this.namespace = namespace; if (namespace != null) { setDisplayName("PortletApplicationContext for namespace '" + namespace + "'"); } }
/** * This implementation supports pattern matching in unexpanded WARs too. * @see PortletContextResourcePatternResolver */ @Override protected ResourcePatternResolver getResourcePatternResolver() { return new PortletContextResourcePatternResolver(this); }
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (this.portletContext != null && bean instanceof PortletContextAware) { ((PortletContextAware) bean).setPortletContext(this.portletContext); } if (this.portletConfig != null && bean instanceof PortletConfigAware) { ((PortletConfigAware) bean).setPortletConfig(this.portletConfig); } return bean; }
/** * This implementation supports file paths beneath the root of the PortletContext. * @see PortletContextResource */ @Override protected Resource getResourceByPath(String path) { return new PortletContextResource(this.portletContext, path); }
/** * Create and return a new {@link StandardPortletEnvironment}. Subclasses may override * in order to configure the environment or specialize the environment type returned. */ protected ConfigurableEnvironment createEnvironment() { return new StandardPortletEnvironment(); }
/** * 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)); }
public void setNamespace(String namespace) { this.namespace = namespace; if (namespace != null) { setDisplayName("Portlet ApplicationContext for namespace '" + namespace + "'"); } }
/** * This implementation supports pattern matching in unexpanded WARs too. * @see PortletContextResourcePatternResolver */ @Override protected ResourcePatternResolver getResourcePatternResolver() { return new PortletContextResourcePatternResolver(this); }
/** * This implementation supports file paths beneath the root of the PortletContext. * @see PortletContextResource */ @Override protected Resource getResourceByPath(String path) { return new PortletContextResource(this.portletContext, path); }
/** * Return a new {@link StandardPortletEnvironment} */ @Override protected ConfigurableEnvironment createEnvironment() { return new StandardPortletEnvironment(); }