Could you include actual snippets of the code?  In my code that backs
the Velocity templates, I'm using code like the following:

// get a List of Maps. The map contains keys of "id" and "name"
List<Map<String,String>> routeList = getRouteList();
// the following is for Spring Web Flow but just results in the
"routeList" variable ending
// up in the Velocity context
context.getRequestScope().setAttribute("routeList",routeList);

And in the Velocity template, I'm using:

#foreach($route in $routeList)
  $route.id
  $route.name
#end

However, I'm sure you understand that if you are getting the else
block everytime, that means the $Array is either null, non-existant or
false.  Are you sure that are actually placing $Array into the
Velocity context?

On 6/13/05, Paul Goepfert <[EMAIL PROTECTED]> wrote:
> Ok this here is my problem.  I  have a web page that I want to be able
> to display dynamic content on.  In my source program I have a Vector of
> objects that I have fields in it like first name, Last name, and
> address.  I want to be able to access these fields.  In my webpage I
> have an if statement (#if($Array))  and a #foreach statement my #foreach
> statement is
> #foreach ($person in $Array) and I have calls like $person.getFirst() in
> my webpage.  I  have created a method that should fill up the variable
> Array and then merge that with velocity template.  However when I try
> and view the dynamic content All I get is  the else block in my web
> page.  If  you need more information let me know.
> 
> -Paul
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to