Re: Mysterious(?) carriage returns

2015-04-06 Thread Heikki Hyyrö
Chris Pratt  kirjoitti 7.4.2015 kello 0.32:
> 
> I believe line breaks in HTTP are always represented as  pairs,
> regardless of the Client or Server OS's


Thanks for the tip; it helped me to look for the right thing and verify that 
HTML 4.01 specification indeed states exactly what you said: 
http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4 


-Heikki





Re: Mysterious(?) carriage returns

2015-04-06 Thread Chris Pratt
I believe line breaks in HTTP are always represented as  pairs,
regardless of the Client or Server OS's
  (*Chris*)

On Mon, Apr 6, 2015 at 2:07 PM Heikki Hyyrö  wrote:

> Hi,
>
> I have been stumped by the following problem: newlines within text
> received from an html form show up in the form ”\r\n” in our Struts 2
> -based application. I am wondering how this is possible because I have
> verified the following:
>
> 1) The system is running on OS X or Linux, so the OS default newline is
> ”\n”.
>
> 2) The Java virtual machine reports ”\n” as its newline character
> (System.getProperty(”line.separator”)) when running the Struts 2
> -application in a debugger.
>
> 3) When inspecting the form text in a browser debugger, the text shows
> newlines in the form ”\n” just before the form is submitted. I
> double-checked this by inspecting the actual character code values.
>
> 4) When I set a breakpoint to the bean-setter of the corresponding action
> in the Struts 2 application and let the form submission from the browser be
> executed, the setter receives the form text as a String-parameter where the
> newlines have become ”\r\n”.
>
> What can be the reason for this? The form submission mechanism (something
> on the browser-side or in Tomcat) or the way Struts 2 handles form
> parameters before feeding them to the action? I want to get rid of these
> extra carriage returns but would very much like to find some other way than
> writing special code (such as a custom parameter interceptor) for reverting
> the text back to its original form...
>
> -Heikki
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


RE: Mysterious(?) carriage returns

2015-04-06 Thread Sean Powell
The OS with the browser submitting the page is Windows?

-Original Message-
From: Heikki Hyyrö [mailto:heikki.hy...@uta.fi] 
Sent: Monday, April 06, 2015 4:03 PM
To: Struts Users Mailing List
Subject: Mysterious(?) carriage returns

Hi,

I have been stumped by the following problem: newlines within text received 
from an html form show up in the form ”\r\n” in our Struts 2 -based 
application. I am wondering how this is possible because I have verified the 
following:

1) The system is running on OS X or Linux, so the OS default newline is ”\n”.

2) The Java virtual machine reports ”\n” as its newline character 
(System.getProperty(”line.separator”)) when running the Struts 2 -application 
in a debugger.

3) When inspecting the form text in a browser debugger, the text shows newlines 
in the form ”\n” just before the form is submitted. I double-checked this by 
inspecting the actual character code values.

4) When I set a breakpoint to the bean-setter of the corresponding action in 
the Struts 2 application and let the form submission from the browser be 
executed, the setter receives the form text as a String-parameter where the 
newlines have become ”\r\n”.

What can be the reason for this? The form submission mechanism (something on 
the browser-side or in Tomcat) or the way Struts 2 handles form parameters 
before feeding them to the action? I want to get rid of these extra carriage 
returns but would very much like to find some other way than writing special 
code (such as a custom parameter interceptor) for reverting the text back to 
its original form...

-Heikki
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Mysterious(?) carriage returns

2015-04-06 Thread Heikki Hyyrö
Hi,

I have been stumped by the following problem: newlines within text received 
from an html form show up in the form ”\r\n” in our Struts 2 -based 
application. I am wondering how this is possible because I have verified the 
following:

1) The system is running on OS X or Linux, so the OS default newline is ”\n”.

2) The Java virtual machine reports ”\n” as its newline character 
(System.getProperty(”line.separator”)) when running the Struts 2 -application 
in a debugger.

3) When inspecting the form text in a browser debugger, the text shows newlines 
in the form ”\n” just before the form is submitted. I double-checked this by 
inspecting the actual character code values.

4) When I set a breakpoint to the bean-setter of the corresponding action in 
the Struts 2 application and let the form submission from the browser be 
executed, the setter receives the form text as a String-parameter where the 
newlines have become ”\r\n”.

What can be the reason for this? The form submission mechanism (something on 
the browser-side or in Tomcat) or the way Struts 2 handles form parameters 
before feeding them to the action? I want to get rid of these extra carriage 
returns but would very much like to find some other way than writing special 
code (such as a custom parameter interceptor) for reverting the text back to 
its original form...

-Heikki
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org