O'Reilly logo

JSF 2.0 Cookbook by Anghel Leonard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extracting data from an uploaded CSV file

As you probably know, CSV (Comma-Separated Value) files are text files that stores values separated by commas. Usually a CSV file has a header and sets of values that are written one set per line. Each line in the CSV file corresponds to a row in the table. For example let's consider the following CSV content, example.csv:

Name,Age,E-mail
Mike,27,mike@yahoo.com
Susan,29,susan@gmail.com
Tom,20,tom@yahoo.com
Elly,32,elly@gmail.com

In this recipe, we will upload this file to the server and we will extract the data into an ArrayList.

Getting ready

We developed this recipe with NetBeans 6.8, JSF 1.2, and GlassFish v3. The JSF 1.2 classes were obtained from the NetBeans JSF 1.2 bundled library. In addition, we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required