Counter using Struts Taglibs

2003-02-06 Thread Vinay
Hi All,
How can I define counters using Struts EL tag libraries for printing purposes in 
JSP pages



Here is an example

table border=1
 c:forEach var=transid items=${trans.transactions}
 tr
  tdc:out value=${transid.acctno}//td
  tdc:out value=${transid.testcode}//td

if($transid.testcode==ts  ) tscount=tscount+1;   

  tdc:out value=${transid.srcfac}//td
   tdc:out value=${transid.dateofservice}//td
   tdc:out value=${transid.htkey}//td

 /tr
 /c:forEach
 
/table

In the above code i would like to print the total and number of iterations the for 
loop performed.

I would also like to do some condition to inside the for loop to print another 
specific counter

like 
eg:--
if($transid.testcode==ts  ) tscount=tscount+1;   



I am novice and  have recently started using these tag libraries.Is there a link or 
web site which has tutorials on how to use the tag libraries.



Any help appreciated

thanks


Vinay







Re: Counter using Struts Taglibs

2003-02-06 Thread Shawn Bayern
On Thu, 6 Feb 2003, Vinay wrote:

 Hi All,
 How can I define counters using Struts EL tag libraries for
 printing purposes in JSP pages

It looks like you're really asking about JSTL tags, not Struts.

You can use c:set to increment a variable, as in

 c:set var=counter scope=session value=${counter + 1} /

 I am novice and have recently started using these tag libraries.Is
 there a link or web site which has tutorials on how to use the tag
 libraries.

The JSTL specification is available at http://java.sun.com/products/jstl.
If that's too technical for you at the moment, there are also several
books on JSTL; more info on mine is available at the URL below.

-- 
Shawn Bayern
JSTL in Action   http://www.manning.com/bayern


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