For more convenient and quick web development SevenHats provides an ability to use JavaServer Faces in front-end tier. The framework also includes integrated Facelets and Spring WebFlow libraries as common solutions in templating and navigation for JSF. All the mentioned libraries are used as internal bundle libraries and expose only some part of the functionality as dynamic services. There is also QuipuKit library integration provided as a separate bundle.
Core JSF functionality is integrated into SevenHats using the org.sevenhats.web.api.ServletProvider implementation (see Web Integration for more details on servlet providers). Key integration details:
- JSF-Spring integration, which is certainly provided since SevenHats is built partially on top of Spring. There is a custom JSF variable resolver which takes into account all the OSGi specific and tries to resolve variable in context of bundles that provides a requested page.
- Faces servlet can be additionally configured passing the init parameters via the extension point (see org.sevenhats.jsf.api.JSFPropertiesProvider).
SevenHats provides an ability to use QuipuKit on JSF pages as a separate bundle. Currently, the QuipuKit bundle uses so called "buddy classloading" on runtime as to org.sevenhats.jsf bundle, because due to some technical reasons JSF integration and QuipuKit bundles should be present in classpath of each other.
Facelets library is used as templating solution. It is used as internal library of the org.sevenhats.jsf bundle, therefore its integration into the core JSF framework is traditional and doesn't have any differences from the non-OSGi use case: Facelets provides the JSF view handler.
Theoretically, any of the custom component libraries can be supported using facelets.LIBRARIES Faces servlet init parameter to provide the Facelets tag libraries description.
Entity-specific page fragments
When talking about object relationships in OSGi environment, there is a common problem to generate edit pages for entities which may have unpredictable relationships on runtime. SevenHats provides ability to specify parameterized reusable panels for different types of relationships: one-to-one, one-to-many, many-to-many (see org.sevenhats.ui.jsf.api.*Provider). Any bundle can expose the service which provides template for entity of certain type.
Spring WebFlow is used to handle navigation inside the application. Similar to Facelets, it is used as an internal library of the org.sevenhats.jsf bundle. Currently there is an ability to register new flows on runtime using particular exposed service
- org.sevenhats.jsf.api.FlowRegistrator - allows to register custom Spring WebFlow flows