This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Servlets and the fly likes Writer already called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Writer already called" Watch "Writer already called" New topic

Writer already called

Vikas Aggarwal
Ranch Hand

Joined: Jun 22, 2001
Posts: 140

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.

Vikas Aggarwal

Founder @
Leads and Deals Limited
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
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?
Have you checked out Aspose?
subject: Writer already called
It's not a secret anymore!