Re: h:inputTextArea swallows one leading newline

From: Daniel Lichtenberger <>
Date: Fri, 19 Apr 2013 08:42:41 +0200

Hi Manfred,

Sound nice - I'm not sure about the attribute name, since it requires
that the user already knows the solution to the problem. Maybe
"preserveLeadingNewlines" or something along these lines?


On 04/18/2013 04:12 PM, Manfred Riem wrote:
> Hi Daniel,
> Would you be OK with something like this?
> <h:inputTextarea ....>
> <f:attribute name="addNewLineAtStart" value="true">
> </h:inputTextarea>
> If so we could add this without changing current behavior and thus
> not break backwards compatibility
> Let me know what you think about this?
> Regards,
> Manfred
> On 4/18/2013 4:37 AM, Daniel Lichtenberger wrote:
>> Hi Manfred,
>> On 04/11/2013 05:53 PM, Manfred Riem wrote:
>>> I would suggest if you want to make sure that you don't lose content to
>>> add a \n at the beginning and the end on the server side of your
>>> application.
>> I also tried this, but it gets ugly very quickly (now you need a
>> special getter for providing the value to the input).
>>> Note you probably want to review your pages if you have more than one
>>> page using the textarea tag and make sure they are all used in the same
>>> way.
>> I believe the Rails guys fixed this by always writing a newline after
>> the opening <textarea> tag, which (I think) would also work in JSF -
>> note that the issue is specific to the textarea tag, as it _doesn't_
>> trim leading whitespace (except the newline immediately following the
>> opening tag).
>> Daniel
>>> Regards,
>>> Manfred
>>> On 3/25/2013 2:14 PM, wrote:
>>>> Hi Manfred,
>>>> Thanks for the quick reply.
>>>>> If you think the specification and thus the implementation of
>>>> h:inputTextarea needs to
>>>>> deal with this you probably are looking a specification issue, which
>>>> are tracked at
>>>>> the JAVASERVERFACES_SPEC_PUBLIC jira issue tracker.
>>>> I'm not sure how deep the issue goes - maybe the browser behaviour
>>>> depends on the DOCTYPE? Were there any changes in the XML writers? Did
>>>> each JSF application since 1.0 have this (admittedly obscure) issue
>>>> with textareas? Did older, less standards-conformant browsers behave
>>>> differently? I'd like to hear if other people had/have this problem,
>>>> too.
>>>> Daniel