CSV publishing ver. 1.2

        Java Servlet lets you quickly publishing so called commas separated values files. CSV files are text files where rows contain data separated by commas (separator is actually configurable). It is a standard and portable way to present source data in many systems. And this component simply lets you quickly display them on the web. How to use it:

1) copy csvPackage.jar into WEB-INF/lib directory

2) describe CSVPublishing servlet in your web.xml file:


3) describe a mapping for this servlet


You must provide a configuration file describes how to display your data as well as the various interface settings. You can use CSVPublishing in two forms:

a) pass configuration file as a parameter. E.g.:


b) define your configuration file as an initial parameter for servlet (parameter name is config):


and use servlet in this form:


Configuration file is a text file, each line describes one parameter in the form of


Empty lines and any line starts with # or // are ignored. Current version supports the following list of parameters:

# data - describes your data file. This parameter is mandatory

# title. Describes a title for your page. Default value is empty (no title)
title=My data

# header. You can set here some file contains any html-code.
# This code will be outputted at the beginning of the each page.
# So you can set for example some banners or CSS styles.
# By default this value is empty

# footer. You can set here some file contains any html-code. This code will be
# outputted at the bottom of the each page. So you can set for example some banners.
# By default this value is empty

# body. Describes a CSS style for the body. Default value is background-color:#FFFFFF

# firstRow. Describes a CSS style for the first row. Default value is background-color:#FFFFFF

# oddRow. Describes a CSS style for odd rows. Default value is background-color:#FFFFFF

# evenRow. Describes a CSS style for even rows. Default value is background-color:#FFFFF0

# page. Describes a size for the pages (in rows). Default value is 50

# width. Describes a width for your data table. E.g.:

# columns. Describes a commas separated list of displayed columns starting from 1.
# E.g.: 1,3,5 - outputs the first, third and fifth columns only
# By default is empty (all the columns will be printed)

# separator. Describes a separator. Default value is ,.
# Possible values are ,; or t. Value t marks here a tab separator

Note: configuration file can be saved anywhere on your server. E.g. if you are using CSVPublishing?config command we assume this file is saved under the root directory (docBase) of your container. But you can of course always use full name for setting config file location: CSVPublishing?/home/users/my_file (or CSVPublishing?c:\users\my_file)

For JSP check out also CSV taglib in Coldtags suite

For downloading:

servlet: csvPackage.jar
sample of config file:  csvconf.txt

 © Coldbeans     Comments?

See also JSOS - the largest collection of servlets and filters.

Also in JSOS: