Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to send an array of Strings as a html response from the doPost of the servlet  RSS feed

 
balu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all...
i have an array of strings which i want to display in my html response being generated by the servlets doPost method...
The point is..like i use..
out.println(<>String 1)
out.println(String 2)....how do i end it.....b'coz what i have is a an array and though i get to know its length in a variable how do i break the printing and let the out.println know that it is the last string.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use a for loop


Or did I miss something?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!