This is just a wild hunch, as I donβt know what kind of web infrastructure you are using, etc., but:
Text from <textarea> is likely to have line breaks ( \n ), but HTML interprets them as whitespace. So, on the java side, you need to do something like this:
String forOutput = input.replace("\n", "<br />\n");
However, in almost all imaginary web environments, there is a utility method that does this for you manually or automatically, so the question is to find the right one for you.
source share