This week's book giveaway is in the iOS forum.
We're giving away four copies of Classic Computer Science Problems in Swift and have David Kopec on-line!
See this thread for details.
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 3441
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: 66607
161
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: 3441
39
  • 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!