后端拼接时用:"\n"分割,比如: String str = "白日依山尽,\n" + "黄河入海流;"; 返回前台页面时,放入 <pre></pre> 标签中即可实现换行。 转载于:https://www.cnblogs.com/Big-Boss/p/10536511.html