Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay DXP JSF-Portlet as OSGI Component (Portlet)?
Hi All,
I have made JSF-Portlet with command shell:
mvn archetype:generate \
-DarchetypeGroupId=com.liferay.faces.archetype \
-DarchetypeArtifactId=com.liferay.faces.archetype.primefaces.portlet \
-DarchetypeVersion=5.0.5 \
-DgroupId=com.mycompany \
-DartifactId=com.mycompany.my.primefaces.portlet
Result from mvn install was one war file - as is usual for non OSGI portlet.
Is there any possibility make JSF-Portlet as OSGI Component same as MVC-Portlet?
Thank you
Hi Oleksandr,
Although it
is possible to create an OSGi WAB that contains a JSF Portlet,
we strongly recommend that you continue to use JavaEE WARs for
your portlets. There are several pitfalls and issues that come with
using OSGi to manage JSF portlets. If you are looking to obtain OSGi
services in a JSF portlet, you can instead use Liferay’s static
utilities or a ServiceTracker. In the future, you’ll also
be able to use CDI to @Inject services.* If you are
trying to use another OSGi feature in your portlet, please let us know
what it is and we can look to see if it’s possible without using a
Declarative Services portlet.
*For more info, check out Ray Auge’s OSGi CDI Integration Specification talk at Devcon 2018 (or wait for the recorded video).
Glad I could help! Let us know if you have any more questions. Thanks
for using Liferay Faces!
- Kyle