Java MVC全栈框架 ActFramework

码农软件 · 软件分类 · Web框架 · 2019-03-25 18:28:50

软件介绍

ActFramework是一种简洁易用,具有强大表达力的Java MVC全栈框架:

一个返回HelloWorld的请求处理器(演示视频 : 7分钟):

@GetAction("/hello")
public String sayHello() {
    return "Hello World!"
}

一个完整的User RESTful服务应用(演示视频 : 7分钟):

package demo.helloworld;

import act.controller.Controller;
import act.db.morphia.MorphiaAdaptiveRecord;
import act.db.morphia.MorphiaDao;
import org.mongodb.morphia.annotations.Entity;
import org.osgl.mvc.annotation.*;

import java.util.Map;

import static act.controller.Controller.Util.notFoundIfNull;

@Entity("user")
public class User extends MorphiaAdaptiveRecord {

    @Controller("user")
    public static class Service extends MorphiaDao {

        @PostAction
        public User create(User user) {
            return save(user);
        }

        @GetAction
        public Iterable list() {
            return findAll();
        }

        @GetAction("{id}")
        public User show(String id, Map data) {
            return findById(id);
        }

        @PutAction("{id}")
        public User update(String id, Map data) {
            User user = findById(id);
            notFoundIfNull(user);
            user.mergeValues(data);
            return save(user);
        }

        @DeleteAction("{id}")
        public void delete(String id) {
            deleteById(id);
        }
    }

}

推荐视屏

3分钟观察ActFramework的热加载特性:
* 广告版
* 翻墙版

7分钟在Eclipse中无中生有创建ActFramework的Hello World应用:
* 广告版
* 翻墙版 

7分钟了解ActFramework独一无二的AdaptiveRecord特性
* 广告版
* 翻墙版 

30分钟学习ActFramework的三种路由机制
* 广告版
* 翻墙版

30分钟创建TODO应用(MongoDB版)
* 广告版
* 翻墙版 

25分钟了解ActFramework强大易用的配置特性
* 广告版
* 翻墙版 

25分钟学习ActFramework的命令行支持
* 广告版
* 翻墙版 

1小时学习ActFramework开发RESTFul服务
* 广告版
* 翻墙版 

 

本文地址:https://www.codercto.com/soft/d/2141.html

Blog Design Solutions

Blog Design Solutions

Richard Rutter、Andy Budd、Simon Collison、Chris J Davis、Michael Heilemann、Phil Sherry、David Powers、John Oxton / friendsofED / 2006-2-16 / USD 39.99

Blogging has moved rapidly from being a craze to become a core feature of the Internetfrom individuals sharing their thoughts with the world via online diaries, through fans talking about their favori......一起来看看 《Blog Design Solutions》 这本书的介绍吧!

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具