25262728293031
public class AfterController { @Action("index") public View someAction() { return new HTMLPage(); }
3132333435363738
} @AfterAction public View afterAction() { return new HTMLPage() .withH1Content("after/index"); }
33343536373839
return new Redirect("/mvc/serv/redirecting"); } @DefaultAction public View defAction() { return new HTMLPage().withH1Content("redirected!"); }
35363738394041
@Inject private HttpServletRequest request; @DefaultAction public View defaultAction() { return new HTMLPage(); }
4041424344454647
return new HTMLPage(); } @Action("some-action") public View doSomething() { return new HTMLPage() .withH2Content("annot/some-action " + getParameter("var")); }
46474849505152
return new JSON(json); } @DefaultAction public View defaultAction() { return new HTMLPage(); }
2526272829303132
public class BeforeController { @BeforeAction public View beforeAction() { return new HTMLPage() .withH1Content("before/index"); }
32333435363738
} @Action("index") public View someAction() { return new HTMLPage(); }
6970717273747576
@Action("set-var") public View setVarAction(@Param("var") String var) { someStatefulVar = var; return new HTMLPage() .withH1Content("some-stateful/set-var"); }
7677787980818283
} @Action("get-var") public View getVarAction() { return new HTMLPage() .withH2Content(someStatefulVar != null ? someStatefulVar : "null"); }