Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

JSP Code to iterate Excel file

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP code which will open the contents of a excel file.
Now i need this contents of the excel file to be added dynamically to a table in the sameJSP.Please let me know how to proceed.At the maximum 10 rows can be added dynamically.
Assuming i have a table in JSP which has heading first name,last name,DOB and Gender.After opening the excel through JSP the contents needs to be iterated and added to the columns mentioned.Can some one please help me?.

Posts: 43011
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You would not do this in a JSP (which is purely for creating a view9; but in Java code - either a backing bean or a servlet. You can use the Apache POI library to do this. Then you would add everything the JSP page needs to a collection, which you can then iterate over on the JSP via JSTL.

Or you can use a tag library like DisplayTag to create the table (but you'd still use POI to read the file).
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!