All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ch.mfrey.thymeleaf.extras.cache.CacheDialect Maven / Gradle / Ivy

Go to download

A dialect for Thymeleaf that allows you to do partial page caching. Some parts of our webpage will never change during the lifetime of the application or a usersession, but the part should still be dynamic in the beginning. Working with Thymeleaf 3.0.0+ (3.0.0.RELEASE and its dependencies included)

There is a newer version: 3.0.1
Show newest version
package ch.mfrey.thymeleaf.extras.cache;

import java.util.HashSet;
import java.util.Set;

import org.thymeleaf.dialect.AbstractDialect;
import org.thymeleaf.processor.IProcessor;

public class CacheDialect extends AbstractDialect {
	public static final String DIALECT_NAMESPACE = "http://www.thymeleaf.org/extras/cache";

	public static final String DIALECT_PREFIX = "cache";

	public static final String CACHE_PREFIX = "CacheDialect_";

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Set getProcessors() {
		HashSet processors = new HashSet();
		processors.add(new CacheProcessor());
		processors.add(new CacheAddProcessor());
		
		processors.add(new CacheEvictProcessor());
		return processors;
	}

	public String getPrefix() {
		return DIALECT_PREFIX;
	}

	public boolean isLenient() {
		return false;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy