The moose likes Servlets and the fly likes Writing to ServletOutputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Writing to ServletOutputStream" Watch "Writing to ServletOutputStream" New topic

Writing to ServletOutputStream

philip johnson
Ranch Hand

Joined: Dec 25, 2007
Posts: 40
I got a filter to write Copyright to my all jsps at top, I created a filter to do the job, when I accessing the serveletoutputstream and write the Copyright appears in somewhere in the page , thus stopping the page from displaying correctley.
Anybody knows it why, and a solution.please.matter utgent.

Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

Why dont you use JSP fragments to display copyright information.You'll get better formatting than a writer or a output stream. Moreover an output stream is generally used for binary data.

and a solution.please.matter utgent.

Please ease up a bit and show some patience.

Hope this helps

|Asking Good Questions|
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63857

This is a poor use for a filter. And as you can see, creates some problems.

If you have something you'd like to prefix or postfix to each and every page, look up the concept of JSP preludes and codas.

Or simple create some tag files or simple tags. That's what I'd do for a greater degree of control.

[Asking smart questions] [About Bear] [Books by Bear]
philip johnson
Ranch Hand

Joined: Dec 25, 2007
Posts: 40
Hi Guys
Thanks for the reply, I sorted it out. It is easy for my project to use filter, instead using jsp .
I agree. Here's the link:
subject: Writing to ServletOutputStream
It's not a secret anymore!