More taglib ver. 1.1

    Custom JSP taglib - widget for text files. Lets you read the given amount of lines from the text file. This taglib is opposite to Tail taglib. Lets you simulate a more command from your OS. Body tag more reads the first N rows from the given file and executes own body for the each row. One of parameters (id) describes a nested page scope variable (type is java.lang.String) you can use for access to the current row. Also you can provide a starting index (by default is 1 - from the first row).

For example:
 


<%@ taglib uri="taglib.tld" prefix="m" %>

<!-- read first 10 rows and print them -->
<m:more file="c:/webserver/log.txt" count="10" id="S">
  <br><%=S%>
</m:more>

Tags are:

more

Body tag executes own body for the each row at the beginning of the given file. Attributes are:

1) file describes a source file
2) id Optional attribute. Describes a name for page scope variable. Default value is line.
3) count Optional attribute. Describes a counter for rows. Default value is 20.
4) from Optional attribute. Describes a starting index. Default value is 1 (from the first row).

for downloading:

Library: moretag.jar    Description: taglib.tld

 © Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: