Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writer already called

 
Vikas Aggarwal
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a jsp and a servlet. The servlet has been included in JSP. The servlet uses gzip stream to read file and send to browser. The problem is that when this JSP is called it throws witer already called exception. I understand this is because JSP has already a writer "out" which has been called and my servlet also has one.

Is there a way to get around this problem. I can not convert servlet to jsp because of security.

Thanks in advance.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any time binary streamed data is involved, you should stear clear of JSPs. Why is the servlet accessed from a JSP - can't the servlet be accessed directly?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic