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


Win a copy of Spring in Action this week in the Spring forum!
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: 61434
    
  67

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: 61434
    
  67

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat appends CRLF to the response string?