textarea中值假如有換行,在保存到數據庫時將換行保存成了\n,而在使用free marker生成word時,會將\n替換成空格。所以將text area值中將\n替換<w:br/>即可。
String content = textArea.replaceAll("\n", "<w:br/>"));
首發地址:http://gengshuwu.com/html/blog/1243918567629357057.html
textarea中值假如有換行,在保存到數據庫時將換行保存成了\n,而在使用free marker生成word時,會將\n替換成空格。所以將text area值中將\n替換<w:br/>即可。
String content = textArea.replaceAll("\n", "<w:br/>"));
首發地址:http://gengshuwu.com/html/blog/1243918567629357057.html