mentaframework.org
Mentawai - Authentication
http://www.mentaframework.org/mtw/Page/Authentication
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. With Mentawai, it is easy to implement an authentication mechanism for your web site. All the details are already taken care of by the BaseLoginAction. And by the AuthenticationFilter. Both provided by Mentawai. Creating the login action:. Passequals("abc123") { return ERROR; } setSessionObj(user); return SUCCESS; } }. Protecting action access from unauthorized requests:. When you ...
mentaframework.org
Mentawai - Custom Tags
http://www.mentaframework.org/mtw/Page/CustomTags
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. Mentawai allows you to easily create your own custom tags. Here we explain how to create display and conditional tags. Else if (nFriends = 0) { return "You have no friends at all! Don't code too much! Else { return "You have " nFriends " friends! You can also create a tag that supports a body and use the getBody() method. Create the TLD file:. Xml version="1.0" encoding="UTF-8"?
mentaframework.org
Mentawai - Quick Start
http://www.mentaframework.org/mtw/Page/QuickStart
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. We recommend you use Maven so you can easily run and test this web application with the Jetty plugin. You can click here. To see and download the pom.xml you can use to build and run the code below. Or if you don't want to use Maven you can click here. From the command line: svn co http:/ soliveirajr.com/mentatutorials/HelloMenta/trunk HelloMenta. The Mentawai controller - servlet ...
mentaframework.org
Mentawai - DB Connection
http://www.mentaframework.org/mtw/Page/DB
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. Mentawai internally supports three different connection pools: DBCP, C3P0 and BoneCP. We recommend BoneCP. Setting up in the application manager:. The connection pool is fully integrated with the IoC container so you can get a connection from anywhere. You also need not worry about returning the connection. Public class JdbcUserDAO implements UserDAO { private final String blah; pr...
mentaframework.org
Mentawai - Data Lists
http://www.mentaframework.org/mtw/Page/DataLists
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. A web application can have one or more static data lists that it has to display and control. For example, the list of states, a list of genders, a list of accepted payment methods, etc. With Mentawai you can define localized and non-localized static lists in the database to load and display easily in the web application. Loading in the application manager:.
mentaframework.org
Mentawai - Action Input and Output
http://www.mentaframework.org/mtw/Page/InOut
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. Action Input and Output. The basic Action input contract:. Getting and populating any object with the values from the Action input with just one method call:. Let's say you have all the properties of an User object in the action input. You can get one by one to instantiate the User object or you can just call the getObject() method:. The basic action Output contract:. Output.se...
mentaframework.org
Mentawai - Action Contexts
http://www.mentaframework.org/mtw/Page/Contexts
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. Behaves like a map, with some particularities. Context is an application scope map that you can use to save any information across your whole application. It is a good place for a cache for example. Context can be used to save state across multiple web requests from the same client. Authentication is done that way so it allows a context reset when you want to say bye to the user.
mentaframework.org
Mentawai - Filters
http://www.mentaframework.org/mtw/Page/Filters
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. Are the building blocks of the Mentawai framework. You can configure them in the application manager by action or for all actions (global filter). Set up in the application manager:. Null) { Input input = action.getInput(); input.setValue(KEY, cache); } return chain.invoke(); / next filter or the action } @Override public void destroy() }. A simple authentication filter:. Import o...
mentaframework.org
Mentawai - Environment Properites
http://www.mentaframework.org/mtw/Page/Properties
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. The properties are loaded from the following directory structure inside your web application:. Accessing the properties inside the application manager:. PropsgetBoolean("email.send email") { Email.setSendEmail(false); } else { Email.setDefaultHostName(props.getString("email.host") ; Email.setDefaultSslConnection( props.getBoolean("email.ssl") ); Emai...Note that the Props.
mentaframework.org
Mentawai - Validation
http://www.mentaframework.org/mtw/Page/Validation
I'm in a dialog. The confirmation message goes here. Edit comment: ( optional. Action Input and Output. ORM and SQL builder. With Mentawai you can perform validation inside the action using the Validatable. Interface or you can create a separate filter just for that. The first method is preferred. Here is an example:. Setting up the filter in the application manager:. Override public void loadFilters() { filter(new ValidationFilter() ; }. Performing the validation in the action:. For more advanced valida...