I have been looking at Velocity for the last couple of days
and have got the forumdemo application running.

I am now trying to build and debug my first application.
I have an action class that obtains a collection of documents
represented by a Java object.  I put these in the context
with ctx.put( "listAll", myCollection.toArray() );

My template has the following code:

      #if ( $hasDocuments )
       #foreach ( $item in $listAll )
        <tr>
          <td bgcolor="#eeeeee" align="center">
            DOC:  $item.getName()
          </td>
        </tr>
       #end
      #else
       <tr>
         <td bgcolor="#eeeeee" colspan="4">
          <b>No documents found</b> Please try another query!
         </td>
       </tr>
      #end

My collection is not null, however, my output page only shows
the label Name: and no actual document names.

The velocity log doesn't help:
...
Tue Mar 13 10:18:40 EST 2001   [info]
     ** Property Override : runtime.log.warn.stacktrace = true
Tue Mar 13 10:18:40 EST 2001   [info]
     ** Property Override : runtime.log.info.stacktrace = true
Tue Mar 13 10:18:40 EST 2001   [info]
     ** Property Override : runtime.log.error.stacktrace = true
Tue Mar 13 10:18:40 EST 2001   [info]
     ** Property Override : counter.initial.value = 0
Tue Mar 13 10:18:40 EST 2001   [info]
     ** Property Override : resource.loader.1.resource.path = template
...
Tue Mar 13 10:18:42 EST 2001   [info] Attempting to find
  http://localhost/MSSQLportal/cm/template/doclist.vm with
  org.apache.velocity.runtime.resource.loader.AgResourceLoader

I searched the mail archives but could not find any relevant
information on debugging.

Can anyone point me in the right direction?

Thanks,
Kevin

Reply via email to