001package io.jstach.opt.spring.webflux.example.message;
002
003import org.springframework.context.annotation.Bean;
004import org.springframework.context.annotation.Configuration;
005
006import io.jstach.opt.spring.webflux.JStachioModelViewConfigurer;
007
008/**
009 *
010 * Spring configuration to add a {@link JStachioModelViewConfigurer} for MessagePage.
011 *
012 * @author dsyer
013 *
014 */
015@Configuration
016public class MessageConfiguration {
017
018        /**
019         * Creates the configurer for Spring
020         * @return configuer specific to Message
021         */
022        @Bean
023        public JStachioModelViewConfigurer configurer() {
024                return (page, model, request) -> {
025                        if (page instanceof MessagePage message) {
026                                message.message = "Hello configured!";
027                        }
028                };
029        }
030
031}