Mentawai is a MVC framework following the traditional action paradigm. The picture below summarizes its architecture:
An Action naturally has an Input and an Output. It also has access to three maps or contexts: Application, Session and Cookies. Whenever a web request is initiated by the browser a new Action instance is created by the Mentawai controller. The action execution process takes information from its input, application, session, cookies, database, file system, etc. and generates other information that is placed in its output. One important piece of information always generated by any action is a String result which determines the action Consequence. A consequence can be a JSP forward, a redirect to some other URL, a file download, a JSON ajax response, etc.
Before the action is executed one or more filters can be applied to it. A filter wraps around the action so it can modify its input and output before and after the action is executed. Filters give a high degree of flexibility to the framework and a loose coupling among its features. For example, you can create a filter to validate the input before allowing the action to be executed. Or to check the session to make sure the user is authenticated. Or to catch any exception thrown by the action and forward the response to a nice page where the exception can be logged, formatted and displayed. The majority of Mentawai features are implemented through filters and the framework makes it extremely easy to create and apply your own filters.