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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 307 by torben, Thu Sep 10 18:11:53 2009 UTC revision 586 by torben, Fri Feb 5 19:28:36 2010 UTC
# Line 2  Line 2 
2      pageEncoding="ISO-8859-1"%>      pageEncoding="ISO-8859-1"%>
3  <%@ page import="java.util.List" %>  <%@ page import="java.util.List" %>
4  <%@ page import="dk.thoerup.traininfoservice.banedk.DepartureBean" %>  <%@ page import="dk.thoerup.traininfoservice.banedk.DepartureBean" %>
5  <%  <%@ taglib uri="http://java.sun.com/jstl/core"    prefix="c" %>
6  String stationname = (String) request.getAttribute("stationname");  <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
7  List<DepartureBean> departurebeans = (List<DepartureBean>) request.getAttribute("departurebeans");  
8  int stationID = (Integer) request.getAttribute("stationID");  <c-rt:set var="advanced" value="${requestScope.advanced}"/> <!-- similar to request.getAttribute("advanced") -->
9  boolean advanced = false;  <c-rt:set var="stationname" value="${requestScope.stationname}"/>
10  String advStr = request.getParameter("advanced");  <c-rt:set var="departurebeans" value="${requestScope.departurebeans}"/>
11    <c-rt:set var="stationID" value="${requestScope.stationID}"/>
   
 if (advStr != null) {  
         advanced = Boolean.parseBoolean(advStr);  
 }  
   
12    
 %>  
13    
14  <!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">
15  <html>  <html>
16  <head>  <head>
17  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
18  <title>Train info : <%= stationname %></title>  <title>Train info : ${stationname}</title>
19  </head>  </head>
20  <body>  <body>
21    
22  <h2>Station: <%= stationname %></h2>  <h2>Station: ${stationname} </h2>
23  <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>
24  <table border="1">  <table border="1">
25          <tr>          <tr>
26                  <th>Time</th>                  <th>Time</th>
27                  <th>Updated</th>                  <th>Updated</th>
28                  <%= advanced ? "<th>Trainnumber</th>" : "" %>                  <c-rt:if test="${advanced == true}">
29                            <th>Trainnumber</th>
30                    </c-rt:if>
31                  <th>Destination</th>                  <th>Destination</th>
32                  <%= advanced ? "<th>Origin</th><th>Location</th>" : "" %>                  <c-rt:if test="${advanced == true}">
33                            <th>Origin</th>
34                            <th>Location</th>
35                    </c-rt:if>
36                  <th>Status</th>                  <th>Status</th>
37                  <th>Note</th>                  <th>Note</th>
38          </tr>          </tr>
39  <% for(DepartureBean dep : departurebeans) { %>          
40            <c-rt:forEach var="dep" items="${departurebeans}">
41          <tr>          <tr>
42                  <td><%= dep.getTime() %></td>                  <td>${dep.time}</td>
43                  <td><%= dep.getUpdated() %></td>                  <td>${dep.updatedString}</td>
44                  <%= advanced ? "<td>" + dep.getTrainNumber() + "</td>" : "" %>                                  
45                  <td><%= dep.getDestination() %></td>                  <c-rt:if test="${advanced == true}">
46                  <%= advanced ? "<td>" + dep.getOrigin() + "</td>" : "" %>                          <td>${dep.trainNumber}</td>
47                  <%= advanced ? "<td>" + dep.getLocation() + "</td>" : "" %>                  </c-rt:if>
48                  <td><%= dep.getStatus() %></td>                  
49                  <td><%= dep.getNote() %></td>                  <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>          </tr>
60  <% } %>          </c-rt:forEach>
61    
62                    
63  </table>  </table>
64    

Legend:
Removed from v.307  
changed lines
  Added in v.586

  ViewVC Help
Powered by ViewVC 1.1.20