我正在使用Servlet中的Printwriter打印文本文件。
PrintWriter writer = response.getWriter();
while ((text = reader.readLine()) != null)
{
writer.print(text);
}
尽管这会打印txt文件,但不会打印任何新行。
我试过了
LINE ="\n"
writer.print(text + LINE);
不起作用。
也尝试过使用println,仍然没有用。
有什么建议??
使用<br>
html标签。
LINE ="<br>"
writer.print(text + LINE);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句