Привет, есть Vaadin Application для Liferay.
@Configurable(autowire= Autowire.BY_TYPE)
public class TestPortletApplication extends Application {
Хотелось бы поиметь в этом классе инъекции из контекста.
<?xml version="1.0" encoding="UTF-8"?>
<web-app
metadata-complete="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>course-portlet</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
<taglib-location>
/WEB-INF/tld/liferay-portlet.tld
</taglib-location>
</taglib>
</jsp-config>
</web-app>
На данный момент подбираю бины из функции:
private Object getServiceByName(String name) {
PortletContext portletContext = ((PortletApplicationContext2) getContext()).getPortletSession().getPortletContext();
ApplicationContext context =PortletApplicationContextUtils.getWebApplicationContext(portletContext);
return context.getBean(name);
}