From: Marc P. <ma...@an...> - 2003-08-01 11:14:56
|
I just got, using the latest CVS source: org.webmacro.engine.BuildException: Error parsing template: FileTemplate:xxxxxx (name removed) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 The problem seems to be related to #begin...#end handling, possibly to do with nested directives (#set). If I remove my EXPLICIT #begin...#end it works fine. The line is marked in the template below. I will add a test case for this. #include "includes/header.wmt" <h2>Generator for SQL CREATE TABLE based on Metalizer Schema</h2> <form action="gensql.wmt" method="post"> Schema name: <input name="$Ignition.FormFieldName.schemaName" #if ($Ignition.FieldValue.schemaName) value="$Ignition.FieldValue.schemaName" #end > <input type="submit" value=" Generate "> </form> #if ($Ignition.FieldValue.schemaName) <h3>SQL follows:</h3> #set $schema = $Ignition.getSchema($Ignition.FieldValue.schemaName) <pre> CREATE TABLE tablename ( #set $first = true #foreach $group in $schema.FieldGroups #begin #foreach $fieldName in $schema.getFieldNamesInGroup($group) #begin #set $field = $schema.getField($fieldName) !!!!!!!!!!!! This next line is the problem #if ($first) #begin #set $first = false #end #else #begin , #end $field.Name $field.DataType.Name #end #end ); </pre> #end -- Marc Palmer Contract Java Consultant/Developer w a n g j a m m e r s java and web software design experts with an ethical outlook http://www.wangjammers.org |