File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 42965
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?
I agree. Here's the link:
subject: Writer already called
It's not a secret anymore!