aspose file tools
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

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

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: 2752

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: 62113

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] [Bear's FrontMan] [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 .
It is sorta covered in the JavaRanch Style Guide.
subject: Writing to ServletOutputStream