I have a textarea field in an HTML form. When the user submits the form, a servlet inserts the content of the textarea in Oracle database. When the contents of the textarea are retrieved from the database and displayed on a servlet or a JSP, line breaks and other formatting aren't displayed. I tried using the HTML PRE tag (preformatted), but that didn't fix the problem. Any ideas on how to store the textarea in a database and/or how to display the retrieved contents from the database. Thx. Ulvi. [ March 03, 2003: Message edited by: Ulvi Cetin ]
Nothing to do with servlets really... But other than line breaks, what kind are formatting are you talking about? Not much else is possible. With regard to the line breaks themselves, are they coming back to you in the request parameter for the text area? If so, is something stripping them out going into or coming out of the DB? The text area control has some funky behavior on various browsers, and there are a slew of non-standard wrap attributes that some older browsers supported but whose behavior is non-deterministic. I'd suggest checking to see if the line breaks are being sent as part of the request parameter, and if not, reposting your question, along with the relevant HTML and handler code in the HTML forum. hth, bear [ March 03, 2003: Message edited by: Bear Bibeault ]
Bear, thanks for your reply! I tried to view the contents of the textarea in the servlet (the one that is supposed to insert them into the database). I got the contents by request.getParameter("contents") and displayed them by out.println(contents) and I don't see line breaks in this output either. So, as you suggested, I think something is stripping the line breaks (before they are inserted in the database) between the form page and the servlet. But what?? Thx. Ulvi.