on 3/13/01 7:32 AM, "McKenzie, Kevin" <[EMAIL PROTECTED]> wrote:

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

That's good. All you have to do is download it and run Tomcat. :-)

http://jakarta.apache.org/builds/jakarta-velocity/demo/

> 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 )

why not:

#if ($listAll.size() > 0)

??????

> #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.

What does your myCollection.toArray() object look like? Does it have a
getName() method?

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>

Reply via email to