I am doing the following validation. Middle newlines and newlines at the
end are preserved but newlines at the beginning are vanishing. I can see
the newline at the beginning being returned from the db and hibernate
but they disappear when displayed in the jsp.        

<field-validator type="requiredstring">
            <param name="trim">false</param>
            <message>body is required</message>
        </field-validator>
        <field-validator type="stringlength">
            <param name="minLength">1</param>
            <param name="maxLength">512</param>
            <message>body length must be between 1 and 512</message>
        </field-validator> 

-----Original Message-----
From: Antonio Petrelli [mailto:[EMAIL PROTECTED] 
Sent: 17 May 2007 11:22
To: Struts Users Mailing List
Subject: Re: newline being ignored

2007/5/17, David Harland <[EMAIL PROTECTED]>:
>
> I have a jsp with a textarea whose name is body. The text contained in

> body is newline then some text. The form is then posted to an action 
> that then writes it away to the database. If I then go back to view 
> the same page the newlline character has been removed. The text is 
> being trimmed by struts before it is displayed in the textarea.



Curious. What if the newline is in the middle of the text? does it
behave correctly?

Antonio


- ------
ML {UFI}

______________________________________________________________________
Ufi Limited 
Registered in England No.  3980770 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

learndirect Solutions Ltd 
Registered in England No. 5081669 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

UFI Charitable Trust 
Registered in England No.  3658378 
Registered Charity No.  1081028 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

This email has been scanned by the MessageLabs Email Security System.

______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to