001package io.jstach.opt.spring.webflux.example.message;
002
003import org.springframework.stereotype.Controller;
004import org.springframework.web.bind.annotation.GetMapping;
005import org.springframework.web.reactive.result.view.View;
006
007import io.jstach.opt.spring.webflux.JStachioModelView;
008
009/**
010 * Example controller that uses a View which has global state injected into it via a
011 * handler interceptor.
012 *
013 * @author dsyer
014 */
015@Controller
016public class MessageController {
017
018        /**
019         * Here we use the global configurer to inject state into the {@link View}.
020         * @return reactive jstachio view
021         */
022        @GetMapping(value = "/message")
023        public View message() {
024                return JStachioModelView.of(new MessagePage());
025        }
026
027}