This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 39547
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?

Ping & DNS - updated with new look and Ping home screen widget
I agree. Here's the link:
subject: Writer already called
Similar Threads
Writing byte data through jsp
JSP: IllegalStateException problem
session problem in jsp
Tomcat's CompressionFilter + ExampleFilter code
problen about unreadable character when a currency character is expected(CHINESE)