001 package com.khubla.pragmatach.examples.thymeleafexample;
002
003 import java.util.Date;
004
005 import com.khubla.pragmatach.framework.annotation.Controller;
006 import com.khubla.pragmatach.framework.annotation.Route;
007 import com.khubla.pragmatach.framework.annotation.View;
008 import com.khubla.pragmatach.framework.api.PragmatachException;
009 import com.khubla.pragmatach.framework.api.Response;
010 import com.khubla.pragmatach.plugin.thymeleaf.ThymeleafController;
011
012 @Controller(name = "IndexController")
013 @View(view = "index.html")
014 public class IndexController extends ThymeleafController {
015 /**
016 * the message
017 */
018 private final String message = "hello world";
019
020 public String getMessage() {
021 return message;
022 }
023
024 @Route(uri = "/")
025 public Response render() throws PragmatachException {
026 return super.render();
027 }
028
029 public String getTime() {
030 return new Date().toString();
031 }
032 }