struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Struts Wiki] Update of "StrutsQuickStartJSP" by MichaelJouravlev
Date Wed, 21 Feb 2007 00:27:05 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification.

The following page has been changed by MichaelJouravlev:

New page:
== Employee list with pure JSP (Model 1) ==

Before the data list is displayed, it should be retrieved from a database and saved into appropriate
J2EE scope like request, session or application. Then the list is iterated and its content
is shown line by line. Notice JSTL 2.0 usage.


{{{<%@ page import="java.util.ArrayList, model.EmployeeManager"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%-- Load data from the storage --%>

    if (session.getAttribute("employees") == null) {
        session.setAttribute("employees", EmployeeManager.loadEmployees());

<%-- Display data --%>

        <th align="left">Emp #</th>
        <th align="left">Name</th>
        <th align="left">Salary</th>
      <c:forEach var="employee" items="${employees}">


View raw message