I have a JSP page with a textarea HTML component. When a user presses enter and goes to next line while typing in textarea,and when he clicks save button, it saves the data from
The replaceAll method return a new String. Your variable a is never modified.
To solve your problem : a = a.replaceAll("\n","<br />");
a = a.replaceAll("\n","<br />");
In this kind of method, reading the javadoc is time saver.
Regards.