About Milestones Me Mail Service Impressum Werner Diwischek
action4java logo

Different Things


Action4JAVA is a simple to use template mechanism. It works without programming any java code. Extendible "actions" are called when a template is interpreted. Originally its created to generate code for a Java projects.

In technical terms action4JAVA is a lightweight, modular and extendible open source Java component framework with a template core. It uses a directory type object storage J-Tree which loads and deliver data from Excel sheet or database requests. An XML loader is in work.

Don't repeat yourself

Templates can avoid the "repeating yourself" (DRY) in a project. In a typical project one has at least four repeatition, whatever programming language one use:

Repetition within the code itself is not just boring and daunting, but also error-prone and expensive. In most projects there is a machinary of sql, configurations and methods doing the same things with some object vars. For any changes one need somebody who master the technologies and knows the application.

Where one find repeating structures embedded in technology one can strip this structure to "pure data" and wrap this with the help of templates. Typical examples are the data model are xml configurations in frameworks like JSF.


I've started to develop action4Java last year when generating code in a java project from two simple model sheets and templates. I've used it to create

Whatever design pattern one prefer, one can generate the code automatically with some structured data and action4JAVA templates.

The advantages are multifold:

With the help of this opensource tool I offer a fixed price solution for projects which far outcompete any other offers with a standard handicraft coding.


Examples can say more than thousand words so I created some. Even this site is an example of how action4Java works. The examples can run on a local system with a simple Java Runtime Environment - no database or development environment must be configured.


The action4JAVA framework consists of some classes containing an execute method with the following arguments:

Actions can have any purpose. Within the 18 actions you find here there are action where the result string is of no importance at all. These are e.g. the actions for storing data to a db or count line of java code. Actions can be extended for your needs to "outsource" tasks.


One of these actions is the template parser . It basically parses a String for a process tag and instantiate an action class. In Pseudocode this would look like the following:

<!--process  action="actionClass" if="cond"  -->
parsed content value=##value##
<!--process action="templateLoop" filter="<cond> loop="pointer".file="content".../-->

Since a "template" just controls the calling of other actions the template specific extensions are rather simple compared with other template solutions.

action4Java templates have no Java-Code embedded (no action for this is defined :-) - nor define a specialized template language. To manipulate data one can create a new action.

The action approach offers more than a simple Model-View-Control thing embedded in some code: An action4Java template can be "executed" since it controls the load of data or what else is needed.

Since even loaded structured data could contain comment tags, this offers a tremendous flexibility.

And since a "template" just controls the calling of actions one can use it to build applications from actions and use it as a workflow action engine. This means the result of the template parsing doesn't matter.

Who should not read further

You are a programmer who think

You are responsible for a project and you think

... just "kidding" ;-)


The core of action4JAVA works stable with the expected behaviour with all the examples including generating this site. Until now I've invested appoximately three months for program, website and examples. But I was in the lucky situation to use it in projects, so I gained a lot of experience using it and there is some (but small) compatibily overhead with what is parsed.

The version 0.1 with the action approach is a good base for further development. Compared with other template engines its a really nice and powerful approach. There are a lot of possibilities for further things.

Actually an directory access like api for the J-Tree core is started. This means methods known from directories like cd, ls, mkdir, rmdir ... This offers a better and wellknown api for this "data directory" than some put and get methods. It's working and can be downloaded from the git repository. With a new xml mapping this will last during march, since I have to do a lot of stuff beside this project.

To start between almost a billion web sites and ten thousands of framework/templation solutions it's a bit frustrating when you think you have a good idea. So any help/links/comment/recommendation/feedback are appreciated, if you think this is a good idea.


java duke with deers
created by Action4Java and JtreeMap (24.3.2013 22:57)
complexity is easy, simplicity not.