wood burning stoves 2.0*
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Writing to ServletOutputStream" Watch "Writing to ServletOutputStream" New topic
Author

Writing to ServletOutputStream

philip johnson
Ranch Hand

Joined: Dec 25, 2007
Posts: 40
Hi
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.
Thanks.


Philip
SCJP2, SCBCD1.3
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

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


SCJP, SCWCD.
|Asking Good Questions|
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61448
    
  67

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 .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Writing to ServletOutputStream