In my Servlet response, I would like to perform a line break for each println call. Currently the response text shows up all on one line (i.e. "first line second line"). I have experimented with "\n" and setting the setContentType to "text/html" with <br/> to no avail. Please advise.
Here is my test code:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/plain;charset=UTF-8");
PrintWriter pw = response.getWriter();
pw.println("first line");
pw.println("second line");
}