在action的方法里这样写:
String lineSeparator=System.getProperty("line.separator","/n"); response.setContentType("application/export"); response.setHeader("Content-disposition","attachment;filename="+"aaa.txt" ); ServletOutputStream out = response.getOutputStream(); out.print("hello"+lineSeparator+"baby"); return null;