Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

preserving whitespace in readers/streams

Status
Not open for further replies.

dendenners

Programmer
Jul 17, 2001
110
IE
Hello,
I have a process that loads a sql*plus report into an Clob field in an oracle database. I want to display this data 'as is' on a jsp page. I have tried converting the clob to both a stream and a reader and outputting it to the ServletResponse's Reader and OutputStream. My problem is that, although the data in the report is visible on the page, the whitespace(and carriage returns) in the report disappear! Can anyone think what I may be doing wrong? Thanks
 
to half answer my own question:
The problem with the whitespace preservation seemed to be the fact that I needed to enclose the embedded stream in <pre> and </pre> tags to preserve the preformatted text. As I said this preserves the whitespace, but unfortuantely the carriage returns still seem to be missing! I tried both windows and unix format EOL's but to no avail. Any help anyone? Thanks
 
Is it just that even inside your <PRE></PRE> tags, HTML will ignore carriage returns (and tabs for that matter)unless you actually throw in a <BR> or </P> ? I can easily imagine it's the kind of thing that will be browser dependant.
 
Thanks for the input. It seems that the problem (for the CRs) was the way in which I was accessing the Clob. I was using the Clob's getCharacter() method to return a Reader to the JSP. When I used the getAsciiStream() method to return an InputStream, in conjunction with the <pre> tag, everything fell into place nicely thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top