/** * TODO * * @param userProps */ private void loadAutoConfiguration(Properties userProps) { // The JSTL is required by Tiles, which can be used with Thymeleaf but // in any case, if Thymeleaf is available, the JstlMessageResolver // should not be enabled if (LibraryDetector.isJstlAvailable() && !LibraryDetector.isThymeleafAvailable() && userProps != null) { if (!userProps.isEmpty()) { for (Entry<Object, Object> entry : userProps.entrySet()) { String key = entry.getKey().toString(); if (key.contains(I18N_MESSAGE_RESOLVER) && StringUtils.isBlank(entry.getValue().toString())) { userProps.put(entry.getKey(), "com.github.dandelion.datatables.jsp.i18n.JstlMessageResolver"); } } } else { userProps.put("global." + I18N_MESSAGE_RESOLVER, "com.github.dandelion.datatables.jsp.i18n.JstlMessageResolver"); } } } }
/** * <p> * Initialize the request flash data cache only if Thymeleaf is present in * the classpath. * </p> */ public void initRequestFlashDataCache() { if (LibraryDetector.isThymeleafAvailable()) { requestFlashDataCache = new StandardCache<String, RequestFlashData>(100); } }
/** * <p> * Creates and returns the appropriate URL resolver for the given {@link URL} * protocol. * </p> * * @param protocol * The protocol of the location url to scan. * @return The url resolver for this protocol. */ private static UrlResolver createUrlResolver(String protocol) { // Websphere if (protocol.startsWith("wsjar")) { LOG.trace("Selected URL resolver: {}", WebSphereUrlResolver.class.getSimpleName()); return new WebSphereUrlResolver(); } // JBoss 5+ / WildFly if (protocol.startsWith("vfs") || protocol.startsWith("vfszip")) { if (LibraryDetector.isJBossVFS2Available()) { LOG.trace("Selected URL resolver: {}", JBossVFS2UrlResolver.class.getSimpleName()); return new JBossVFS2UrlResolver(); } if (LibraryDetector.isJBossVFS3Available()) { LOG.trace("Selected URL resolver: {}", JBossVFS3UrlResolver.class.getSimpleName()); return new JBossVFS3UrlResolver(); } } LOG.trace("Selected URL resolver: {}", StandardUrlResolver.class.getSimpleName()); return new StandardUrlResolver(); }
if ("vfs".equals(protocol) && LibraryDetector.isJBossVFS3Available()) { LOG.debug("Selected resource scanner: {}", JBossVFS3LocationResourceScanner.class.getSimpleName()); return new JBossVFS3LocationResourceScanner();
/** * <p> * Initialize the request flash data cache only if Thymeleaf is present in * the classpath. * </p> */ public void initRequestFlashDataCache() { if (LibraryDetector.isThymeleafAvailable()) { requestFlashDataCache = new StandardCache<String, RequestFlashData>(100); } }
/** * <p> * Creates and returns the appropriate URL resolver for the given {@link URL} * protocol. * </p> * * @param protocol * The protocol of the location url to scan. * @return The url resolver for this protocol. */ private static UrlResolver createUrlResolver(String protocol) { // Websphere if (protocol.startsWith("wsjar")) { LOG.trace("Selected URL resolver: {}", WebSphereUrlResolver.class.getSimpleName()); return new WebSphereUrlResolver(); } // JBoss 5+ / WildFly if (protocol.startsWith("vfs") || protocol.startsWith("vfszip")) { if (LibraryDetector.isJBossVFS2Available()) { LOG.trace("Selected URL resolver: {}", JBossVFS2UrlResolver.class.getSimpleName()); return new JBossVFS2UrlResolver(); } if (LibraryDetector.isJBossVFS3Available()) { LOG.trace("Selected URL resolver: {}", JBossVFS3UrlResolver.class.getSimpleName()); return new JBossVFS3UrlResolver(); } } LOG.trace("Selected URL resolver: {}", StandardUrlResolver.class.getSimpleName()); return new StandardUrlResolver(); }
if ("vfs".equals(protocol) && LibraryDetector.isJBossVFS3Available()) { LOG.debug("Selected resource scanner: {}", JBossVFS3LocationResourceScanner.class.getSimpleName()); return new JBossVFS3LocationResourceScanner();
/** * TODO * * @param userProps */ private void loadAutoConfiguration(Properties userProps) { // The JSTL is required by Tiles, which can be used with Thymeleaf but // in any case, if Thymeleaf is available, the JstlMessageResolver // should not be enabled if (LibraryDetector.isJstlAvailable() && !LibraryDetector.isThymeleafAvailable() && userProps != null) { if (!userProps.isEmpty()) { for (Entry<Object, Object> entry : userProps.entrySet()) { String key = entry.getKey().toString(); if (key.contains(I18N_MESSAGE_RESOLVER) && StringUtils.isBlank(entry.getValue().toString())) { userProps.put(entry.getKey(), "com.github.dandelion.datatables.jsp.i18n.JstlMessageResolver"); } } } else { userProps.put("global." + I18N_MESSAGE_RESOLVER, "com.github.dandelion.datatables.jsp.i18n.JstlMessageResolver"); } } } }