• 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

How to read the data in CSV file and display it in Drop down list box in JSP  RSS feed

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I have a csv file.For example which should be like
Issue.csv

Number Issue
1 Technical Problem
2 Suggestion on Site
3 Statement Request

I want to read this file(issue.csv) and display the the content of 'Issue' in my JSP page drop down list box let say 'Subject of Issue'

Could you please tell me how to write the code for this thing in my jsp page.

Thanks a lot in Advance.

Regards
Sumanta Panda
 
Ranch Hand
Posts: 2908
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by sumanta panda:

Could you please tell me how to write the code for this thing in my jsp page.



It's not a good practice to write Java Code in JSP file, though you can do that !

Try to implement following steps,

Read a file, parse it , use bean & write the bean data in <select><option value="write bean data"></select>

So lets start, and ask If you stuck in between !!

 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
APACHE POI, a Parser Utility, would be a good place to start
 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apache POI can read XLS files, but not CSV files.

The http://faq.javaranch.com/java/AccessingFileFormats page lists several libraries that can read CSV files (and I recommend that you use a library - CSV is not as simple a format as it looks at first).
[ November 18, 2008: Message edited by: Ulf Dittmer ]
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sagar Sir,
I am very poor in cooding to write this component in java.Could you please give me some idea or send me the source code how to write it.

Thanks a lot in Advance.

Best Regards
Sumanta Panda
 
author
Posts: 3281
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sumanata,

What have you tried so far? It's JavaRanch policy not to just 'hand out code' but to try and guide people with their own efforts. People learn much better that way
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!