In jsp, text in textarea is saved with line breaks and spaces in the database. In textarea, line breaks
UploadNews. jsp
<% @ Page language = "java" contentType = "text/html; charset = UTF-8" pageEncoding = "UTF-8" %> <! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN "" http://www.w3.org/TR/html4/loose.dtd "> <Html>
The line feed function code in ShangchuanNews. jsp is as follows:
<% @ Page import = "java. io. printWriter "%> <% @ page import =" java.net. URLDecoder "%> <% @ page language =" java "contentType =" text/html; charset = UTF-8 "pageEncoding =" UTF-8 "%> <% @ page import =" java. SQL. * "%> <! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN "" http://www.w3.org/TR/html4/loose.dtd "> <Html>
The above jsp Implementation of text in textarea saves line breaks and spaces to the database is a small Editor to share with you all of the content, hope to give you a reference, but also hope you can support a lot of help homes.