• Post Reply Bookmark Topic Watch Topic
  • New Topic

foreach in Servlet

 
David Marco
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I try to do a foreach loop inside doPost or doGet like this:

why the browser outputs all the values together in the same line (like an out.print()) ?
 
David Marco
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found myself the answer to the above "too elemental" question. If I want broken lines, I must insert a <br> tag after each println invocation within the for-each loop, due to println only writes in the response object, but do not format such a flow with implicit new lines. Sorry for waste your time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!