Information Systems



Why does my JSP page add blank lines with text/plan?

If you have something like:

<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%
response.setContentType("text/plain");
out.write("test");
%>

and you get blank lines preceding your output, you need to remove the 2 beginning line feeds so it's like:

<%@ page import="java.io.*" %><%@ page import="java.sql.*" %><%
response.setContentType("text/plain");
out.write("test");
%>