commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <>
Subject Re: [jelly] anteater forEach
Date Tue, 08 Jul 2008 09:00:56 GMT

anteater is not very close to commons to my knowledge, as sebb pointed  
out somewhat quickly.

I looked a bit at the documentation and saw they have jelly support as  
well which provides much of your expectations. The foreach tag,  
however, seems to be theirs.

So, if you allow, here's a jelly answer, all in jelly namespace, which  
is quite close to java itself, I suppose this was your intent of  
posting to this list. This programme reads the lines from "path-to- 
file" and outputs them to output... you should be able to do something  
useful out of it provided you can embed this into anteater.

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly xmlns:j="jelly:core">
  <j:new className="" var="fIn">
    <j:arg value="path-to-file"/>
  <j:new className="" var="input">
    <j:arg value="${fIn}"/>

  <j:set var="line" value="${input.readLine()}"/>
  <j:while test="${not(empty(line))}">
  Here is a line: ${line}
  <j:set var="line" value="${input.readLine()}"/>

Here I have only used the core tag-library of jelly... there's a whole  
lot more you can do with other tag-libraries.
The util tag library (see 
  and examples at

  might actually do the job easier provided you do not have zillions  
of URLs.


Le 07-juil.-08 à 22:12, Kadamban, Sivasankari a écrit :

> Hi,
> I am trying to use anteater for verifying various URLs in our  
> application using foreach.
> <target name="verify">
>   <httpRequest group="server" path="${url}" method="GET">
>       <match>
>         <responseCode value="200"/>
>       </match>
>     </httpRequest>
> </target>
> <foreach list="url1,url2,url3,url4" target="verify" param="url"> </ 
> foreach>
> Is there any way that I can specify the list of URLs in a file and  
> read them through one by one in the "for loop"?
> Thanks,
> Siva

View raw message