当前位置:K88软件开发文章中心网站服务器框架JFinal → 文章内容

3.2 Action

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-25 14:21:32

由 厦门小懒懒 创建, 最后一次修改 2016-10-05 Controller 以及在其中定义的 public 无参方法称为一个 Action。Action 是请求的最小单位。Action 方法必须在 Controller 中声明,该方法必须是 public 可见性且没有形参。ublic class HelloController extends Controller {public void index() { renderText("此方法是一个action");}public void test() { renderText("此方法是一个action");}}以上代码中定义了两个 Action:HelloController.index()、HelloController.test()。在 Controller中提供了 getPara、getModel 系列方法 setAttr 方法以及 render 系列方法供 Action 使用。

3.2 Action