struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Affan Qureshi" <quere...@etilize.com>
Subject Re: line breaks
Date Wed, 22 Jan 2003 06:49:48 GMT
Well thats interesting coz I am experiencing it a bit differently. I have
line breaks in the DB but when they show values in the textarea the text
appears as one block. However if you enter line breaks in the textarea and
then Save the data it goes into the DB *with* the line breaks. But when it
is loaded back again the line-breaks disappear.

This has to do something with the population of HTML controls with the data
because my form-bean values do have line breaks (in setters and getters).
Also if I print these values using <html:write> I get the line breaks as in
the DB. But not in case of <html:textarea>. Quite strange.

Affan

----- Original Message -----
From: "Ben Starr" <b.starr@qut.edu.au>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Wednesday, January 22, 2003 10:45 AM
Subject: Re: line breaks


> 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>
>


--
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