Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Some people like olives. Some don't. I don't like olives. I don't like XML either. Unfortunately, for me, all major Web frameworks rely on XML to do basically everything: setup, configuration, form handling, validation, etc. Welcome to the world of XML "programming."
Another problem for me is that I like to do things really fast. That's why I had a feeling something was wrong with C++. To do a project with C++, medium programmers end up spending more than half their time fighting with the language syntax, pointers, handlers, memory management, unbound arrays, etc., and very little time doing what they're paid to do: the project. The Java language comes to the rescue with an abstraction power that makes everything easy. Whatever pops into your head—Java can do it! You don't have to care how, you just have to use the APIs.
Unfortunately, the Web frameworks out there are not for the medium guys. They require time to master and can scare rookies with XML all over the place and little tricks they are expected to know and get away with. It is like showing a Hello World EJB example to someone that has never seen an Enterprise JavaBeans component before. The result is shock and fear.
Mentawai, an open source framework, tries to break free from this scenario by implementing a small, simple, flexible, idiot-proof MVC (Model-View-Controller) Web framework with no XML at all. Instead of XML, we can use Java code to achieve the same results, and guess what: Java code has Javadocs! You can even compile Java code to catch errors! Java code is object-oriented programming. How about XML?
The most common reply I get from people when I defend this point is: "Hey, you don't have to compile and restart your Web application with XML!" I may be losing something deeper here, but, if you change your XML, you do have to restart your Web context for most of the Web frameworks I have seen. Plus compiling is definitely not a bad thing. It is a good thing! If you could compile XML to quickly discover a wrong attribute, our debbuging time would decrease.
Now that I have argued my point, let's check what Mentawai can offer us as an alternative.
Let's begin by setting up our Web application to use the Mentawai framework. First, place the
mentawai.jar file (downloadable from Resources) inside your application's
/WEB-INF/lib directory and declare in your
web.xml file that you want to use the Mentawai controller:
<!-- The Mentawai controller --> <servlet> <servlet-name>Controller</servlet-name> <servlet-class>org.mentawai.core.Controller</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
<!-- You must choose an extension to indicate a mentawai action --> <servlet-mapping> <servlet-name>Controller</servlet-name> <url-pattern>*.mtw</url-pattern> </servlet-mapping>
Mentawai uses the action paradigm. The main characteristics of a Mentawai action are:
org.mentawai.core.Input) and an output (
java.lang.String) after it executes. The result is usually
ERROR, but you can create your own.
org.mentawai.core.Consequence). Consequences for a Web application are usually
REDIRECT, but you can create your own.
org.mentawai.core.Context). Contexts for a Web application are usually a session context (
org.mentawai.core.SessionContext) and an application context (
org.mentawai.core.ApplicationContext), but you can create your own.
Let's see an example Mentawai action:
|Forum migration complete By Athen|
|Forum migration update By Athen|
|Yes ban XML configuration from other framework By Orden|
|This article is nothing but an advertisement. By Anonymous|
|But there is XML By Anonymous|
|Author completely misunderstands ... By Jan Nicklisch|
|The simplest framework I've seen! By Anonymous|
|Finally somebody who speaks it out loud By Anonymous|
|wicket By Anonymous|
|Stupidest idea I've ever seen By Anonymous|
|Why can't we discuss politely? By Carlos Messeder|
|A Nice Transition Tool By Anonymous|
|Author is clueless about XML benefits! By Anonymous|
|No XML, please! By JavaWorld|
|Another redundant framework to learn By Ajmal|
|Validation rules in code? By Zen Architect|
|Configuration is not into code !!! By Sergio Oliveira|