001 package com.khubla.pragmatach.examples.clusterexample;
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.freemarker.FreemarkerController;
011
012 @Controller(name = "IndexController")
013 @View(view = "index.html")
014 public class IndexController extends FreemarkerController {
015 /**
016 * the time
017 */
018 private String time;
019
020 public String getTime() {
021 return time;
022 }
023
024 @Route(uri = "/")
025 public Response render() throws PragmatachException {
026 time = new Date().toString();
027 return super.render();
028 }
029
030 public void setTime(String time) {
031 this.time = time;
032 }
033 }