@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public ThymeleafViewResolver thymeleafViewResolver(
            @Qualifier("templateEngine") final SpringTemplateEngine springTemplateEngine,
            final ThymeleafProperties thymeleafProperties,
            final ConfigurableApplicationContext applicationContext,
            final List<CasThymeleafViewResolverConfigurer> thymeleafViewResolverConfigurers) {
            val resolver = new ThymeleafViewResolver();
            resolver.setProducePartialOutputWhileProcessing(thymeleafProperties.getServlet().isProducePartialOutputWhileProcessing());
            resolver.setCharacterEncoding(thymeleafProperties.getEncoding().name());
            resolver.setApplicationContext(applicationContext);
            resolver.setExcludedViewNames(thymeleafProperties.getExcludedViewNames());
            resolver.setOrder(THYMELEAF_VIEW_RESOLVER_ORDER);
            resolver.setCache(false);
            resolver.setViewNames(thymeleafProperties.getViewNames());
            resolver.setContentType(appendCharset(thymeleafProperties.getServlet().getContentType(), resolver.getCharacterEncoding()));
            if (!springTemplateEngine.isInitialized()) {
                springTemplateEngine.addDialect(new IPostProcessorDialect() {

                    @Override
                    public int getDialectPostProcessorPrecedence() {
                        return Integer.MAX_VALUE;
                    }

                    @Override
                    public Set<IPostProcessor> getPostProcessors() {
                        return CollectionUtils.wrapSet(new PostProcessor(TemplateMode.parse(thymeleafProperties.getMode()), CasThymeleafOutputTemplateHandler.class, Integer.MAX_VALUE));
                    }

                    @Override
                    public String getName() {
                        return CasThymeleafOutputTemplateHandler.class.getSimpleName();
                    }
                });
            }
            resolver.setTemplateEngine(springTemplateEngine);
            thymeleafViewResolverConfigurers
                .stream()
                .filter(BeanSupplier::isNotProxy)
                .sorted(OrderComparator.INSTANCE)
                .forEach(configurer -> configurer.configureThymeleafViewResolver(resolver));
            return resolver;
        }
This is {@link CasThymeleafAutoConfiguration}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-thymeleaf/src/main/java/org/apereo/cas/config/CasThymeleafAutoConfiguration.java