<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.util.List" import="net.sf.click.util.Format" import="net.sf.click.examples.domain.Customer"%> Click Examples - <%=request.getAttribute("title")%> /style.css" title="Style">

<%=request.getAttribute("title")%>

  /index.html" title="Examples Index">Examples   |   /source-viewer.htm?filename=WEB-INF/classes/<%=request.getAttribute("srcPath")%>" title="Page Java source">Page Java   |   /source-viewer.htm?filename=customer-table.jsp" title="Page Content source">Page JSP   |   /source-viewer.htm?filename=border.htm" title="Page broder HTML template">Border HTML   |   /source-viewer.htm?filename=WEB-INF/click.xml" title="Click application descriptor">click.xml   |   /source-viewer.htm?filename=WEB-INF/web.xml" title="Web application descriptor">web.xml   |   /javadoc/index.html" title="Examples HTML Javadoc API">Javadoc API

Example JSP customers table.

<% List customers = (List) request.getAttribute("customers"); Format format = (Format) request.getAttribute("format"); for (int i = 0; i < customers.size(); i++) { Customer customer = (Customer) customers.get(i); String color = "white"; if (i % 2 == 0) { color = "#f7f7e7"; } %> <% } %>
ID Name Email Age Category Portfolio Date Joined Active
<%=customer.getId()%> <%=customer.getName()%> <%=format.email(customer.getEmail())%> <%=customer.getAge()%> <%=customer.getInvestments()%> <%=format.currency(customer.getHoldings())%> <%=format.date(customer.getDateJoined())%> <% if (customer.getActive().booleanValue()) { %> <% } else { %> <% } %>

 

The CustomerTable page is automatically mapped to the request:
GET customer-table.htm 
When pages are configured to use automapping the ClickServlet will automatically associated the file path customer-table.jsp with the page class CustomerTable.