struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Starr <b.st...@qut.edu.au>
Subject Re: line breaks
Date Wed, 22 Jan 2003 05:45:36 GMT
I looked into this once and as far as I can remember browsers will happily
read files containing \r (Mac), \n (Unix) or \r\n (Windows) line breaks and
display them as separate lines in a text area. However, when they are
submitted back to the server they are always submitted as just \r. I'm not
sure if this is part of the W3C HTML standard but it is what I found from
experimenting with various browsers and line breaks. This may be why your
equals comparison is not working.

Ben


> My problem is that the data in my DB and the form-beans contain line breaks
> but when I populate <nested:textarea> or <html:textarea> with these values
> the line-breaks go away and I see the text as one block.
> 
> BTW I am using redirect=true but I dont think that should make a difference.
> 
> Anyone with such experience/ideas? Thanks for your help.
> 
> Affan
> 
> ----- Original Message -----
> From: "Max Kremer" <mkremer@datastay.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Monday, January 06, 2003 1:31 AM
> Subject: Re: line breaks
> 
> 
>> I use SQL server to populate TEXTAREAs from the DB and update the DB as
>> well.
>> I'm using the <html:textarea> struts tag to accomplish this, and I'm not
>> experiencing any problems.
>> If  I understand your message correctly you're saying that the string
> value
>> is not coming directly from the DB but from Swing.
>> Its probably something along the way thats messing up your string.
>> 
>> ----- Original Message -----
>> From: "Affan Qureshi" <quereshi@etilize.com>
>> To: "struts-user" <struts-user@jakarta.apache.org>
>> Sent: Saturday, January 04, 2003 9:10 AM
>> Subject: line breaks
>> 
>> 
>>> I am using Struts 1.1b2, Tomcat 4.1.12 LE, on Win2K.
>>> 
>>> I have a strange issue. I have a TEXTAREA type control that gets
> populated
>>> from values in database. The value in the database has some line breaks.
> I
>>> store that value in a variable called: "OLD_VALUE". Then I display the
>> value
>>> in the TEXTAREA and when i get it back(from form-bean) after the form is
>>> submitted (without changing the value) i store it in a variable called
>>> "NEW_VALUE". The two DON'T evaluate String.equals() to "true". When I
>> paste
>>> them in notepad I see that OLD_VALUE has line-breaks while the NEW_VALUE
>>> does not have line breaks.
>>> 
>>> Has anyone else faced the same problem? I guess it has something to do
>> with
>>> \r and \r\n for line breaks on different platforms.
>>> 
>>> BTW the data in the database is saved in Oracle 8i through a Swing
>>> client/server app. The App-Server for Swing app is Weblogic on Solaris
> for
>>> SunSPARC. Then the data gets imported to XML and then to MySQL on Win2K.
>>> Then the Struts app loads and display/edits it in the above form.
>>> 
>>> Thanks and regards,
>>> 
>>> Affan
>>> 
>>> 
>>> --
>>> To unsubscribe, e-mail:
>> <mailto:struts-user-unsubscribe@jakarta.apache.org>
>>> For additional commands, e-mail:
>> <mailto:struts-user-help@jakarta.apache.org>
>>> 
>>> -
>>> 
>>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message