[jboss-jira] [JBoss JIRA] (AS7-5873) Servlet response contains DOS-style EOL characters
Cheng Fang (JIRA)
jira-events at lists.jboss.org
Sat Nov 3 22:22:18 EDT 2012
[ https://issues.jboss.org/browse/AS7-5873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cheng Fang updated AS7-5873:
----------------------------
Attachment: test.war
Attaching a test war. To run it,
curl http://localhost:8080/test/ > a.txt
vi a.txt
> Servlet response contains DOS-style EOL characters
> --------------------------------------------------
>
> Key: AS7-5873
> URL: https://issues.jboss.org/browse/AS7-5873
> Project: Application Server 7
> Issue Type: Bug
> Components: Web
> Affects Versions: 7.0.2.SP1
> Environment: Mac OS
> Reporter: Cheng Fang
> Assignee: Remy Maucherat
> Attachments: test.war
>
>
> I'm running AS7 on Mac, but found sometimes my servlet PrintWriter produces output with dos-style eol. When opening the output in vi, there are a couple of ^M at end of line.
> This does not always happen. After trying out a few samples, I found if the line already contains line.separator, then its eol will be ^M. For example,
> {code:java}
> PrintWriter out = response.getWriter();
> out.println("From " + System.getProperty("line.separator") + this);
> {code}
> {noformat}
> From
> test.TestServlet at 180ab18^M
> {noformat}
> If line.separator is not used when constructing servlet output, then everything looks normal.
> My guess is the servlet container may first apply a dos-style eol, then does some sort of replacing with native eol by searching for the first occurrence of line.separator.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list