Search in sources :

Example 1 with DefaultResourceResolver

use of com.sun.faces.facelets.impl.DefaultResourceResolver in project mojarra by eclipse-ee4j.

the class ApplicationAssociate method createFaceletFactory.

protected DefaultFaceletFactory createFaceletFactory(FacesContext context, Compiler compiler, WebConfiguration webConfig) {
    // refresh period
    boolean isProduction = applicationImpl.getProjectStage() == Production;
    String refreshPeriod;
    if (webConfig.isSet(FaceletsDefaultRefreshPeriod)) {
        refreshPeriod = webConfig.getOptionValue(FaceletsDefaultRefreshPeriod);
    } else if (isProduction) {
        refreshPeriod = "-1";
    } else {
        refreshPeriod = FaceletsDefaultRefreshPeriod.getDefaultValue();
    }
    long period = parseLong(refreshPeriod);
    // resource resolver
    DefaultResourceResolver resolver = new DefaultResourceResolver(applicationImpl.getResourceHandler());
    FaceletCacheFactory cacheFactory = (FaceletCacheFactory) FactoryFinder.getFactory(FACELET_CACHE_FACTORY);
    FaceletCache<?> cache = cacheFactory.getFaceletCache();
    DefaultFaceletFactory toReturn = new DefaultFaceletFactory();
    toReturn.init(context, compiler, resolver, period, cache);
    return toReturn;
}
Also used : DefaultFaceletFactory(com.sun.faces.facelets.impl.DefaultFaceletFactory) DefaultResourceResolver(com.sun.faces.facelets.impl.DefaultResourceResolver) FaceletCacheFactory(jakarta.faces.view.facelets.FaceletCacheFactory) MessageUtils.getExceptionMessageString(com.sun.faces.util.MessageUtils.getExceptionMessageString)

Aggregations

DefaultFaceletFactory (com.sun.faces.facelets.impl.DefaultFaceletFactory)1 DefaultResourceResolver (com.sun.faces.facelets.impl.DefaultResourceResolver)1 MessageUtils.getExceptionMessageString (com.sun.faces.util.MessageUtils.getExceptionMessageString)1 FaceletCacheFactory (jakarta.faces.view.facelets.FaceletCacheFactory)1