Agreed. However, there are some things to take into consideration with text
areas that you might not find with other form components. The main thing to
be aware of is line breaks. A user may choose to press enter to force a new
line in a text area. Depending on the HTML setting and the browser/operating
system, these line breaks may come in as part of the text. Many times the
line break comes in simply as a crlf (\n) which is easy to manage. However,
some browsers, such as Netscape for the Mac, will return simply a \r
character instead of the full crlf.

These are not big concerns when using text areas but something to keep in
mind.

-----Original Message-----
From: Balogh Andras <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, August 03, 1999 1:16 AM
Subject: Re: Storing and viewing text area problem


>        Hi!
>
>The textarea should be retrieved as any other text field:
>
>String textarea=req.getParameterValues("textareaname")[0];
>
>Than You can use the <pre> tag (meening preformatted) to keep
>the structure:
>....
>toClient.println("<pre>");
>toClient.println(textarea);
>toClient.println("</pre>");
>......
>
>        Hope it helps,
>
>Best wishes,
>                    Andras.
>
>
>
>
>----- Original Message -----
>From: Rendra Basuki <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, August 03, 1999 2:08 AM
>Subject: Storing and viewing text area problem
>
>
>> Hi Guys,
>>
>> I have two questions for you.
>>
>> One: How do you get the value of a text area in servlet? Do you just
>assign
>> it to a String?
>>
>> Two: How do you keep the structure of the textarea that was inputted?
>> example:
>>
>> if you enter:
>>
>> hello
>> hi
>> ho
>>
>>
>> When I use regular string, it will return like so:
>>
>> hello hi ho
>>
>> What I want is to keep the structure as:
>>
>> hello
>> hi
>> ho
>>
>>
>> When I use StringBuffer as the type of the variable, the java told me
that
>> the data that I was about to get (textarea) was not compatible. What
>should
>> I do?
>>
>> I use access database as the tryup.
>>
>> Please help me,
>>
>> Thanks in advance.
>>
>> Rendra
>>
>>
>___________________________________________________________________________
>> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
>body
>> of the message "signoff SERVLET-INTEREST".
>>
>> Archives: http://archives.java.sun.com/archives/servlet-interest.html
>> Resources: http://java.sun.com/products/servlet/external-resources.html
>> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to