This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Tomcat appends CRLF to the response string? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Tomcat appends CRLF to the response string?" Watch "Tomcat appends CRLF to the response string?" New topic
Author

Tomcat appends CRLF to the response string?

Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 671
I send a string to browser as attachment. When I save the attachment to disk and open it, the string always ends with a CRLF (Catrige return, newline).
Does Tomcat do this or browser do this?



There are 3 lines in the saved file from browser: (You can see the CRLF when using notepad++ and turn on "view all charrachters")

1 abcd
2 CRLF
3


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63211
    
  69

Read the javadoc for the println() method.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 671
Thanks Bear.

Looks like I forgot the basics of Java!

Thanks.

Bruce
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63211
    
  69

 
Have you checked out Aspose?
 
subject: Tomcat appends CRLF to the response string?
 
It's not a secret anymore!