html problem in a .jsp
I am having a problem.
this is the code:
List<QueryDescription> queries = null;
Config f = new Config();
queries = f.getQList();
out.println(queries.size());
out.println("<table border=\"1\">");
开发者_Go百科 out.println("<tr><td><b>Select One</b></td>");
out.println("<td><b></b>#</td>");
out.println("<td><b>Name</b></td>");
out.println("<td><b>Description</b></td></tr>");
for (QueryDescription qd: queries) {
out.print("<tr><td><input type=\"radio\" name=\"rButton\" value=\"" + qd.getId() + "\"></td>");
out.print("<td>" + qd.getId() + "</td>");
out.print("<td>" + qd.getName() + "</td>");
out.print("<td>" + qd.getDescription() + "</td>");
out.print("</tr>");
}
I am trying to print out in the table: 1st column: radio button 2nd column: id 3rd column: name 4th column: description
any help would be great!
thanks,
SORRY GUYS. THE PROBLEM IS THAT IT IS PRINTING OUT EVERY OBJECT IN EVERY TD EXCEPT THE FIRST RADIO BUTTON COLUMN... WEIRD
Without knowing what the problem is, you need to close your table tag.
out.print("</table>")
I don't see any problem but the missing <table> closing tag:
out.println("</table>");
Also, check the encoding of your out object, and don't forget to close/flush the stream
加载中,请稍侯......
精彩评论