I have a method in my servlet where I have some prints to the console..
private void collectingWorkPositions(HttpSession session, HttpServletRequest request)
{
System.out.println("Collecting1..");
//code...
System.out.println("Collecting2..");
//code...
System.out.print("printing p: ");
for(Integer i:p)
System.out.print(i + " ");
}
When this method iscalled, only
Collecting1..
Collecting2..
are printed in the console. When I am refreshing the JSP page, only then the last print (without the ln) isprinted. I know that the difference between these two is that println
will print on a new line where print
will print at the same line, so why is this not happening here in the same action ?