/[projects]/android/TrainInfoService/WebContent/ViewDepartures.jsp
ViewVC logotype

Contents of /android/TrainInfoService/WebContent/ViewDepartures.jsp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 586 - (show annotations) (download)
Fri Feb 5 19:28:36 2010 UTC (14 years, 3 months ago) by torben
File size: 1862 byte(s)
This is a more correct way of reading request attributes
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 pageEncoding="ISO-8859-1"%>
3 <%@ page import="java.util.List" %>
4 <%@ page import="dk.thoerup.traininfoservice.banedk.DepartureBean" %>
5 <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
6 <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
7
8 <c-rt:set var="advanced" value="${requestScope.advanced}"/> <!-- similar to request.getAttribute("advanced") -->
9 <c-rt:set var="stationname" value="${requestScope.stationname}"/>
10 <c-rt:set var="departurebeans" value="${requestScope.departurebeans}"/>
11 <c-rt:set var="stationID" value="${requestScope.stationID}"/>
12
13
14 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
15 <html>
16 <head>
17 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
18 <title>Train info : ${stationname}</title>
19 </head>
20 <body>
21
22 <h2>Station: ${stationname} </h2>
23 <a href="DepartureServlet?station=${stationID}&format=html&advanced=${!advanced}">Switch view</a><br>
24 <table border="1">
25 <tr>
26 <th>Time</th>
27 <th>Updated</th>
28 <c-rt:if test="${advanced == true}">
29 <th>Trainnumber</th>
30 </c-rt:if>
31 <th>Destination</th>
32 <c-rt:if test="${advanced == true}">
33 <th>Origin</th>
34 <th>Location</th>
35 </c-rt:if>
36 <th>Status</th>
37 <th>Note</th>
38 </tr>
39
40 <c-rt:forEach var="dep" items="${departurebeans}">
41 <tr>
42 <td>${dep.time}</td>
43 <td>${dep.updatedString}</td>
44
45 <c-rt:if test="${advanced == true}">
46 <td>${dep.trainNumber}</td>
47 </c-rt:if>
48
49 <td>${dep.destination}</td>
50
51 <c-rt:if test="${advanced == true}">
52 <td>${dep.origin}</td>
53 <td>${dep.location}</td>
54 </c-rt:if>
55
56 <td>${ dep.status }</td>
57 <td>${ dep.note }</td>
58
59 </tr>
60 </c-rt:forEach>
61
62
63 </table>
64
65
66 </body>
67 </html>

  ViewVC Help
Powered by ViewVC 1.1.20