Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Need help while exporting CSV file using JSP  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

while exporting csv file from jsp im getting empty csv file.

Any help is much appreciated.

 
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should not even be attempting to do stuff like this in JSP. JSP is for generating HTML pages, not computation and manipulation of output streams.

Save yourself lots of trouble and look into servlet code designed to handle file transfer.

Bill
 
Ranch Hand
Posts: 355
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pushpa,
Are you getting the correct values in sbf?




 
Rancher
Posts: 3595
39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you're not getting an IllegalStateException?
Because I'm pretty sure using getOutputStream inside a JSP page will result in that (at least it used to) as the JSP has already called getWriter to write its own stuff out as pretty much the first thing it does.
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bottom line, you are using the wrong tool.



Move all this code to a servlet as your first step.
 
Dave Tolls
Rancher
Posts: 3595
39
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That resembles some of my DIY attempts...
:)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!