Friday, September 26, 2008

The validators

I will change the design of jmap.validators.
Now, the validators is using a set of if(...) to distinguish the annotation type. I should use another pattern to handle it. A set of classes may declare a common method to handle the "valid" and "formatMessage".
And the error messages may need more extra information. A field name may need to indicate this message's field.

Saturday, September 20, 2008

Java On Rails

This is a ruby on rails succedaneum for Java. You can find the code and examples here.
http://code.google.com/p/jmap/

This framework can make URI map to Class and a Method call, and automatically create a form value bean to map the form values to bean's fields, use the validating annotations to check these values and output the multi-language error messages.

For example, the URI: /jmap/main/login, will be map to the class "package.prefixname.controller.Main" and call the controller class method "public void Login()". Before the controller method call, a form value bean "package.prefixname.bean.main.Login" will be created and set all form values to its fields and checked against the fields validating annotations. So, in the controller method call, you can easily get this form bean from the request attribute with a key name "MainLogin". You can check this bean's status for the form values validating and any other business data status to determin a response with a "render" method call.

Monday, September 01, 2008

Block the appspot.com?

So, in the grate China, after the Olympic Game, the appspot.com has been blocked. Cannot access anymore.