
public void importFile(BlobDomain fileData) { InputStream inStr = fileData.getInputStream(); Workbook workbook = Workbook.getWorkbook(inStr); Sheet sheet = workbook.getSheet(0); int colCount = sheet.getColumns(); int rowCount = sheet.getRows(); Cell a,b,c,d,e,f,g,h; LabelCell lc; NumberCell nc; for (int r=1; r < rowCount; r++) { h = sheet.getCell(0,r); a = sheet.getCell(1,r); g = sheet.getCell(4,r); b = sheet.getCell(6,r); c = sheet.getCell(7,r); d = sheet.getCell(8,r); e = sheet.getCell(9,r); f = sheet.getCell(11,r);
if (h.getType() == CellType.LABEL)
{
lc = (LabelCell) h;
trxId = new Number(lc.getString().trim());
} else if (h.getType() == CellType.NUMBER)
{
nc = (NumberCell) h;
trxId = new Number(nc.getValue());
}
} }

Please visit the following links:
http://www.roseindia.net/tutorial/java/poi/readExcelFile.html
http://www.roseindia.net/answers/viewqa/JSP-Servlet/9741-read-excel-data-from-jsp.html
You need POI library.
Download zip file from the following link:
http://download.nextag.com/apache/poi/release/bin/
Then put the poi-3.2-FINAL-20081019.jar,poi-contrib-3.2-FINAL-20081019.jar and poi-scratchpad-3.2-FINAL-20081019.jar files into lib folder of your jdk version.