001package io.jstach.opt.spring.example.message; 002 003import org.springframework.stereotype.Controller; 004import org.springframework.web.bind.annotation.GetMapping; 005import org.springframework.web.servlet.View; 006 007import io.jstach.opt.spring.webmvc.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@SuppressWarnings("exports") 016@Controller 017public class MessageController { 018 019 /** 020 * Created by Spring 021 */ 022 public MessageController() { 023 } 024 025 /** 026 * Here we use the global configurer to inject state into the {@link View}. 027 * @return view 028 */ 029 @GetMapping(value = "/message") 030 public View message() { 031 return JStachioModelView.of(new MessagePage()); 032 } 033 034}