velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sara Frongillo" <s.frongi...@itsys.it>
Subject load array vtl
Date Tue, 14 Oct 2003 11:59:18 GMT
Hello,

I have a problem to load a ArrayList in velocity template, in Velocity Servlet I have:

          ArrayList images = new ArrayList();
          ArrayList audios = new ArrayList();
          ArrayList videos = new ArrayList();

          context.put("images", images);
          context.put("audios", audios);
          context.put("videos", videos);

and into Template I use them as follow:

   #foreach($item in $info) 
  #if($item.getDescrTipoInfoMultimediale().equals("Foto"))
     $images.add($item)
  #end
   #if($item.getDescrTipoInfoMultimediale().equals("Audio"))
   $audios.add($item)
  #end
   #if($info.getDescrTipoInfoMultimediale().equals("Video"))
     $videos.add($item)
  #end
    #end

but add() method add only 1 object and no more (if there are).

Will appreciate if someone can help or suggest me a method for load a array in VTL

_________________________________
Sara Frongillo
Software Area

I.T.Sys srl 
C.so Garibaldi, 215
84125 Salerno - Italy

Office +390892580977
Email s.frongillo@itsys.it
Web http://www.nexsoft.it 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message