%@ page import="java.io.*,java.sql.*,java.util.*,java.text.*,com.joshholtzman.thecolvingroup.*" %> <%@ include file="constants.jsp" %> <%@ taglib uri="/tags/struts-html" prefix="html" %> <%@ taglib uri="/tags/struts-bean" prefix="bean" %> <%@ taglib uri="/tags/struts-logic" prefix="logic" %> <%@ taglib uri="/tags/struts-tiles" prefix="tiles" %> <% // Get a list of all properties Connection con = HouseBean.getConnection(); List list = new ArrayList(); try { try { Statement statement = con.createStatement(); ResultSet rs = statement.executeQuery("SELECT * from pacunion ORDER BY theDate DESC, showToPublic DESC"); while (rs.next()) { if ("show".equals(rs.getString("showToPublic"))) list.add(new HouseBean(new Integer(rs.getInt("id")))); } rs.close(); statement.close(); } catch ( SQLException e ) { } finally { con.close(); } } catch (Exception e) { } // Create a map for storing request parameters for links Map map = new HashMap(); // Set page-context attributes pageContext.setAttribute("list", list); pageContext.setAttribute("map", map); // Paging String start = request.getParameter("start"); String end = request.getParameter("end"); if (start==null) start="0"; if (end==null) end="9"; int s = Integer.parseInt(start); int e = Integer.parseInt(end); double pages = Math.ceil(list.size() / 9.); double thisPage = (s/9)+1; // Other utility objects DecimalFormat df = new DecimalFormat(); %>