1 |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" |
2 |
pageEncoding="ISO-8859-1"%> |
pageEncoding="ISO-8859-1"%> |
|
<%@ page import="java.util.List" %> |
|
3 |
<%@ page import="dk.thoerup.traininfoservice.banedk.DepartureBean" %> |
<%@ page import="dk.thoerup.traininfoservice.banedk.DepartureBean" %> |
4 |
<% |
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> |
5 |
String stationname = (String) request.getAttribute("stationname"); |
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %> |
6 |
List<DepartureBean> departurebeans = (List<DepartureBean>) request.getAttribute("departurebeans"); |
|
7 |
int stationID = (Integer) request.getAttribute("stationID"); |
<c-rt:set var="advanced" value="${requestScope.advanced}"/> <!-- similar to request.getAttribute("advanced") --> |
8 |
boolean advanced = false; |
<c-rt:set var="departurebean" value="${requestScope.departurebeans}"/> |
9 |
String advStr = request.getParameter("advanced"); |
<c-rt:set var="stationname" value="${departurebean.stationName}"/> |
10 |
|
<c-rt:set var="stationID" value="${requestScope.stationID}"/> |
|
|
|
|
if (advStr != null) { |
|
|
advanced = Boolean.parseBoolean(advStr); |
|
|
} |
|
|
|
|
11 |
|
|
|
%> |
|
12 |
|
|
13 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
14 |
<html> |
<html> |
15 |
<head> |
<head> |
16 |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
17 |
<title>Train info : <%= stationname %></title> |
<title>Train info : ${stationname}</title> |
18 |
</head> |
</head> |
19 |
<body> |
<body> |
20 |
|
|
21 |
<h2>Station: <%= stationname %></h2> |
<h2>Station: ${stationname} </h2> |
22 |
<a href="DepartureServlet?station=<%=stationID%>&format=html&advanced=<%= !advanced %>">Switch view</a><br> |
<a href="DepartureServlet?station=${stationID}&format=html&advanced=${!advanced}">Switch view</a><br> |
23 |
<table border="1"> |
<table border="1"> |
24 |
<tr> |
<tr> |
25 |
<th>Time</th> |
<th>Time</th> |
26 |
<th>Updated</th> |
<th>Updated</th> |
27 |
<%= advanced ? "<th>Trainnumber</th>" : "" %> |
<c-rt:if test="${advanced == true}"> |
28 |
|
<th>Trainnumber</th> |
29 |
|
</c-rt:if> |
30 |
<th>Destination</th> |
<th>Destination</th> |
31 |
<%= advanced ? "<th>Origin</th><th>Location</th>" : "" %> |
<c-rt:if test="${advanced == true}"> |
32 |
|
<th>Origin</th> |
33 |
|
<th>Location</th> |
34 |
|
</c-rt:if> |
35 |
<th>Status</th> |
<th>Status</th> |
36 |
<th>Note</th> |
<th>Note</th> |
37 |
</tr> |
</tr> |
38 |
<% for(DepartureBean dep : departurebeans) { %> |
|
39 |
|
<c-rt:forEach var="dep" items="${departurebean.entries}"> |
40 |
<tr> |
<tr> |
41 |
<td><%= dep.getTime() %></td> |
<td>${dep.time}</td> |
42 |
<td><%= dep.getUpdated() %></td> |
<td>${dep.updatedString}</td> |
43 |
<%= advanced ? "<td>" + dep.getTrainNumber() + "</td>" : "" %> |
|
44 |
<td><%= dep.getDestination() %></td> |
<c-rt:if test="${advanced == true}"> |
45 |
<%= advanced ? "<td>" + dep.getOrigin() + "</td>" : "" %> |
<td>${dep.trainNumber}</td> |
46 |
<%= advanced ? "<td>" + dep.getLocation() + "</td>" : "" %> |
</c-rt:if> |
47 |
<td><%= dep.getStatus() %></td> |
|
48 |
<td><%= dep.getNote() %></td> |
<td>${dep.destination}</td> |
49 |
|
|
50 |
|
<c-rt:if test="${advanced == true}"> |
51 |
|
<td>${dep.origin}</td> |
52 |
|
<td>${dep.location}</td> |
53 |
|
</c-rt:if> |
54 |
|
|
55 |
|
<td>${ dep.status }</td> |
56 |
|
<td>${ dep.note }</td> |
57 |
|
|
58 |
</tr> |
</tr> |
59 |
<% } %> |
</c-rt:forEach> |
60 |
|
|
61 |
|
|
62 |
</table> |
</table> |
63 |
|
|