asked on
response.setContentType("application/savetodisk;charset=UTF-8");
response.setHeader("Content-Disposition","attachement; filename=list.csv");
out.flush();
out.println("ID; TITLE");
out.println("");
...
ASKER
JavaServer Pages (JSP) allow the development of dynamically generated web pages. It uses the Java programming language; JSP pages are translated into servlets at runtime, with each servlet being cached and reused until the JSP is modified. JSP allows Java code to be interleaved with static web markup content, so the resulting page can be compiled and executed on the server to deliver the content.
TRUSTED BY
We can't use the Tomcat trimSpaces parameter because we have plenty of places where we want JSP values printed with a space between them (like user names, e.g.). But for people just starting a site, they could always make sure that they put the character in where they want spaces.
We decided to switch to servlets for the CSV files, just to avoid the blank lines at the top of the CSV page.