In your org.melati.MelatiServlet.properties set
This will set Melati to use Velocity as it's Template Engine. The resource loader used is an extended ClasspathResourceLoader which will do on-the-fly translations of simple webmacro templates as well as handling Velocity templates. This enables you to use the Melati Admin system in conjunction with your velocity templates.
Note that you will have to change the code in VelocityTemplateEngine if you wish to use a FileResourceLoader, but the code is available and tested.
Input widgets, such as select boxes and popup selections, are rendered using a templet named after their class with an optional classifier called renderInfo in their field attributes.
Templets are found on the classpath in a sub directory of your configured template engine.
The subdirectory is determined by your MarkupLanguage and an optional purpose.
|Default Object WebMacro templet for HTML||org/melati/template/webmacro/templets/html/java.lang.Object.wm|
|Default Object Velocity templet for HTML||org/melati/template/velocity/templets/html/java.lang.Object.wm|
|Error Exception Velocity templet for HTML||org/melati/template/velocity/templets/html/error/java.lang.Exception.wm|
|Error Exception Velocity templet for WML||org/melati/template/velocity/templets/wml/error/java.lang.Exception.wm|
If a templet is not found then the templet loader looks for a templet with the same name as the class on the classpath.
If a templet is still not found then the process is repeated for each of the superclasses of your class until the default templet is reached.
Ensure your utility class has a constructor which takes a single argument of a Melati and then add something like this to your template:
#set $admin = $melati.ContextUtil("org.melati.admin.AdminUtils")
Both WebMacro and Velocity use an overly inclusive caching mechanism, where they introspect all methods on an object when checking for the existance of one method. As a Melati object has methods which return objects from the javax.servlet.http package the servlets jar is required, even when not used.
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'tableinfo'. Make sure it exists and that its name is spelled correctly.
By default MS Access Databases are created with UserCommitSync set to no, use the ODBC Datasource Administrator or Registry Editor to set this to yes.
If that does not work, then run the test or application again, it should work on the second occasion.
This problem was particularly acute for PreparedStatements, which now wait and try again up to 10 times until the Jet Cache resyncs.