<% //******************************************************************** // Written By: Kris // Date: 2 September 2005 Updated: 14 February 2006 // Member: antm_comments.jsp // Description: JSP which displays ANTM Comments by calling a // JavaBean which retrieves them from a database. // // Note: This code includes some extra DIVs in order // to make the presentation more easily re-styled, // ala csszengarden.com. //******************************************************************** %> <% //-------------------------------------------------- // Import //-------------------------------------------------- %> <%@ page import="java.io.* ,java.sql.* ,java.util.* ,antm_jsp.Comment01"%> <% //-------------------------------------------------- // Error Page //-------------------------------------------------- %> <%@ page errorPage="errorPage.jsp" %> <% //-------------------------------------------------- // JavaBeans // When ANTMBean01.java changes, you may have to delete the session // cookie in your browser which may still contain the previous version. //-------------------------------------------------- %> ANTM

View Comments

Choose the cycle you wish to view. If you wish to see another cycle, select a new one from the drop-down list, then press the "Change Cycle" button.

<% //-------------------------------------------------- // Call ANTMBean01 to retrieve list of all Cycles. //-------------------------------------------------- List allCyclesList = ANTMBean01.getAllCycles(); //-------------------------------------------------- // Loop through list and display each cycle as // an item in a selection list form field. //-------------------------------------------------- out.println(""); %>
<% //-------------------------------------------------- // Call ANTMBean01 to retrieve list of comments. //-------------------------------------------------- List commentsList = ANTMBean01.getComments(ANTMBean01.getSelectedCommentsCycle()); if (commentsList.size() == 0) { out.println("

There are no comments to display.

"); } else { out.println("
"); } //-------------------------------------------------- // Loop through list and display each Comment // as an item in a definition list. //-------------------------------------------------- for (int i=0; i < commentsList.size(); i++) { Comment01 comment = (Comment01)commentsList.get(i); out.println("
" + comment.getRaterName() + " - Episode " + comment.getEpisode() + "
"); if (comment.getDispFunFact().equals("y")) { out.println("
Fun Fact: " + comment.getFunFact() + "
"); } out.println("
" + comment.getComments() + "
\n"); } if (commentsList.size() == 0) { } else { out.println("
"); } %>