Summary: | Servlet response writer does not respect line.separator system property | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | Chris Hubick <chris> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | default | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | remove special CoyoteWriter println handling |
Description
Chris Hubick
2008-10-21 10:54:42 UTC
The change is http://svn.apache.org/viewvc?view=rev&revision=298149 I am tempted to leave this as is. Whilst strict adherence to the PrintWriter interface requires that System.getProperty("line.separator") is used, any truly portable web application is going to have to write it's own new lines anyway to be resilient against the case where it runs on a different platform. If this was fixed, I would change the initialisation of LINE_SEP. I see where you are coming from, and somewhat agree - though I think there is value in strict adherance to the API. The decision is yours - I just wanted to make sure you were aware of it. Luckily, I had the code to this servlet and patched it to work around this. Just to note, we were actually bit by this bug when we upgraded from Tomcat 4 on our CAS ( http://www.ja-sig.org/products/cas/ ) central authentication server. The Yale CAS server code writes out XML using the response Writer, and after the upgrade this output then contained the additional '\r'. Of course, this technically shouldn't matter to the XML either, except that the old (2.0.10) mod_cas C client we are using on some old servers apparently doesn't use a real XML parser and breaks reading these line endings in. We can't upgrade the client in our legacy environment because their newer mod_auth_cas client requires a newer Apache. So, yeah, I patched the server to work as before, and we are working to upgrade all our old client servers, but as with any enterprise, that takes time. Just testing a new way to provide an svn link: r298149 or revision 298149 Testing svn links in mail messages - please ignore. r298149 or revision 298149 Testing svn links in mail messages again - please ignore. r298149 or revision 298149 I've fixed this in trunk. I am not going to propose it for back-porting since it might break something and it doesn't make much sense for app servers anyway. But since there is a spec it will be in 7.x Sounds good, thanks! :) |