001    package com.khubla.pragmatach.examples.cacheexample;
002    
003    import java.util.Date;
004    
005    import com.khubla.pragmatach.framework.annotation.CacheControl;
006    import com.khubla.pragmatach.framework.annotation.Controller;
007    import com.khubla.pragmatach.framework.annotation.Route;
008    import com.khubla.pragmatach.framework.annotation.View;
009    import com.khubla.pragmatach.framework.api.PragmatachException;
010    import com.khubla.pragmatach.framework.api.Response;
011    import com.khubla.pragmatach.plugin.freemarker.FreemarkerController;
012    
013    @Controller(name = "IndexController")
014    @View(view = "index.ftl")
015    @CacheControl(maxAge = 10)
016    public class IndexController extends FreemarkerController {
017       public String getTime() {
018          return new Date().toString();
019       }
020    
021       @Route(uri = "/")
022       public Response render() throws PragmatachException {
023          return super.render();
024       }
025    }