• 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

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
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: 3757
40
  • 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.
 
Marshal
Posts: 67164
169
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: 3757
40
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That resembles some of my DIY attempts...
:)
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!