/actframework

An easy to use Java MVC server stack

Primary LanguageJavaApache License 2.0Apache-2.0

ACT Framework

Note

Documentation is ready at

Project status

  • Current stable version: 0.1.2-SNAPSHOT
  • Working on 0.3.0-SNAPSHOT

Install

Add the following dependency into your pom.xml file

    <dependency>
      <groupId>org.actframework</groupId>
      <artifactId>act</artifactId>
      <version>0.3.0-SNAPSHOT</version>
    </dependency>

Add the following snippet into your pom.xml file to get SNAPSHOT version:

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

Introduction

Join the chat at https://gitter.im/actframework/actframework

I love PlayFramework v1.x because it is simple, clear and expressive. It brought us a completely different experience in web development with Java. However I don't totally agree with where Play 2.X is heading for, and it looks like I am not the only person with the concern as per this open letter to Play Framework Developers.

I have thought of rolling out something that could follow the road paved by Play 1.x, something that is simple, clear, expressive and Java (specifically) developer friendly. About one and half year after that I decide I could start the project seriously, and now another one and half year passed by, I've got this ACT framework in a relatively good shape.

Controller sample code:

    @GetAction("/")
    public void home() {
    }

    @GetAction({"/hello", "/hi"})
    public String sayHello() {
        return "Hello Act!";
    }

    @GetAction("/bye")
    public Result byePlayAndSpring() {
        // use text to force response be "text/plain" content type
        return text("bye Play and Spring!!");
    }

    @GetAction("/greeting")
    public void greeting(String who, int age) {
        // if you didn't return render result, Act will throw it out 
        // as an Exception. Just like what Play!framework did 
        render(who, age);
    }

    @GetAction("/product/{catalog}/{prod}/price")
    public Result price(String catalog, String prod) {
        int n = _.random(C.range(100, 400));
        String price = n + ".99";
        return render(catalog, prod, price);
    }

There are a couple of ACT Demo applications could be found at https://github.com/actframework/act-demo-apps, these apps demonstrate the following features of ACT Framework:

All the demo apps shall be able to run directly by cd path/to/app and mvn clean compile exec:exec. Then you can open your browser and navigate to http://localhost:5460. The demo apps are using default view based on Rythm, which is my another open source initiative.

At the moment ACT framework is still under development and not ready for product use. But you are welcome to give it a try and send me feedback by raising issues or send email to actframework@googlegroup.com. **的朋友可以申请加入QQ群:283919975.

You can track ACT Framework development progress at https://trello.com/b/iMsldsST/actframework-0-1

Happy coding!