Madvoc is MVC framework that uses CoC and annotations in a pragmatic way to simplify web application development. It is easy to use, learning curve is small and it is easy to extend. There are no external (xml) configuration, actions are simple POJOs, it is compatible with any view technology, its pluggable and so on… What's best is that it offers several ways how it can be configured or used, so you can tweak it to match your coding preferences.

One minute tutorial

Simple POJO action:

    public class HelloAction {

        String name;

        String value;

        public String world() {
            System.out.println(" " + name);
            value = "Hello World!";
            return "ok";

Above action class defines action method HelloAction#world() that is mapped to the following url: / The resulting view for dispatching is: / Action takes one input request parameter (name) and prepares one request attribute for the output (value). Action is also intercepted by default interceptor stack.

Action from above example uses only defaults; but, it can be configured and written in different ways. For example, the following action is also working in Madvoc:

    public class BookAction {

        public Book get(@In int bookId) {

Method BookAction#get handles GET urls like: /book/123 and displays the result using /book/get.jsp template.

Make and use your own Madvoc conventions!

Action lifecycle

action path

MadvocController receives HTTP request and lookup for ActionConfig (action configuration) for requested action path. If action path is registered, MadvocController instantiates new ActionRequest - encapsulation of action request and action method proxy.

Interceptors intercept the request being sent to and returning from the action. In some cases, interceptor might keep an action from executing. Interceptors can also change the state of an action before it executes.

Filters wraps interceptors, actions and results, similar to servlet filters.

Once execution of the action and all interceptors is complete, the action request is sent to result to render the results.