Custom JSP taglib. This taglib lets you proceed text files in
special formats like commas separated values etc. For example:
<%@ taglib uri="taglib.tld" prefix="csv" %> <csv:forEachRow file="c:/data.txt"> <csv:getField id="A"/> <csv:getField id="B"/> first column: <%=A%> second column: <%=B%> </csv:forEachRow> Body tag forEachRow executes own body for the each row from the given file. Tag getField lets you read (or just print) some column. Tags are: forEachRow Body tag. Executes own body for the each row from the given file. Parameters are: 1) file Describes a file
getField Reads the current (next) field from row. Tag saves extracted value in page scope variable (type is java.lang.String) or prints it. Parameters are: 1) id Optional parameter. Describes a page scope variable. getFields Reads all the fields from current row and saves them in the page scope array. Parameters are: 1) id Describes a page
scope variable. Type is com.cj.csv.Fields. This bean
has got the following methods:
for downloading: Library: csvtag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|